FreeBSD Bugzilla – Attachment 15834 Details for
Bug 29247
fmt should not expand tabs.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
p
p (text/plain; charset=us-ascii), 2.14 KB, created by
ru
on 2001-08-14 14:20:18 UTC
(
hide
)
Description:
p
Filename:
MIME Type:
Creator:
ru
Created:
2001-08-14 14:20:18 UTC
Size:
2.14 KB
patch
obsolete
>Index: fmt.1 >=================================================================== >RCS file: /home/ncvs/src/usr.bin/fmt/fmt.1,v >retrieving revision 1.8 >diff -u -p -r1.8 fmt.1 >--- fmt.1 2001/06/06 10:17:05 1.8 >+++ fmt.1 2001/08/14 13:20:10 >@@ -115,8 +115,13 @@ escaped to protect them from your shell. > .It Fl l Ar number > Replace multiple spaces with tabs at the start of each output > line, if possible. >+Each > .Ar number > spaces will be replaced with one tab. >+The default is 8. >+If >+.Ar number >+is 0, spaces are preserved. > .It Fl t Ar number > Assume that the input files' tabs assume > .Ar number >Index: fmt.c >=================================================================== >RCS file: /home/ncvs/src/usr.bin/fmt/fmt.c,v >retrieving revision 1.15 >diff -u -p -r1.15 fmt.c >--- fmt.c 2001/08/11 00:49:11 1.15 >+++ fmt.c 2001/08/14 13:20:11 >@@ -202,6 +202,15 @@ get_positive(const char *s, const char * > return (size_t) result; > } > >+static size_t >+get_nonnegative(const char *s, const char *err_mess, int fussyP) { >+ char *t; >+ long result = strtol(s,&t,0); >+ if (*t) { if (fussyP) goto Lose; else return 0; } >+ if (result<0) { Lose: errx(EX_USAGE, "%s", err_mess); } >+ return (size_t) result; >+} >+ > /* Global variables */ > > static int centerP=0; /* Try to center lines? */ >@@ -210,7 +219,7 @@ static size_t max_length=0; /* Maximum l > static int coalesce_spaces_P=0; /* Coalesce multiple whitespace -> ' ' ? */ > static int allow_indented_paragraphs=0; /* Can first line have diff. ind.? */ > static int tab_width=8; /* Number of spaces per tab stop */ >-static size_t output_tab_width=0; /* Ditto, when squashing leading spaces */ >+static size_t output_tab_width=8; /* Ditto, when squashing leading spaces */ > static const char *sentence_enders=".?!"; /* Double-space after these */ > static int grok_mail_headers=0; /* treat embedded mail headers magically? */ > >@@ -258,7 +267,7 @@ main(int argc, char *argv[]) { > continue; > case 'l': > output_tab_width >- = get_positive(optarg, "output tab width must be positive", 1); >+ = get_nonnegative(optarg, "output tab width must be non-negative", 1); > continue; > case 'm': > grok_mail_headers = 1;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 29247
: 15834