FreeBSD Bugzilla – Attachment 21345 Details for
Bug 37437
[patch] [request] Add HTTP-style support to vis(1)/unvis(1).
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 4.23 KB, created by
Seth Kingsley
on 2002-04-25 02:30:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Seth Kingsley
Created:
2002-04-25 02:30:01 UTC
Size:
4.23 KB
patch
obsolete
>Index: vis/vis.1 >=================================================================== >RCS file: /home/ncvs/src/usr.bin/vis/vis.1,v >retrieving revision 1.8 >diff -u -p -r1.8 vis.1 >--- vis/vis.1 2002/04/20 12:17:56 1.8 >+++ vis/vis.1 2002/04/25 01:22:07 >@@ -67,6 +67,13 @@ represent a minimum of change to the inp > .It Fl c > Request a format which displays a small subset of the > non-printable characters using C-style backslash sequences. >+.It Fl h >+Request a format which displays non-printable characters using >+a HTTP-style encoding, as described in RFC 1808. The form is >+.Ql Li %dd , >+where >+.Nm d >+represents a hexidecimal digit. > .It Fl F > Causes > .Nm >Index: vis/vis.c >=================================================================== >RCS file: /home/ncvs/src/usr.bin/vis/vis.c,v >retrieving revision 1.9 >diff -u -p -r1.9 vis.c >--- vis/vis.c 2002/03/22 01:42:42 1.9 >+++ vis/vis.c 2002/04/25 01:22:14 >@@ -69,7 +69,7 @@ main(argc, argv) > > (void) setlocale(LC_CTYPE, ""); > >- while ((ch = getopt(argc, argv, "nwctsobfF:ld")) != -1) >+ while ((ch = getopt(argc, argv, "nwchtsobfF:ld")) != -1) > switch((char)ch) { > case 'n': > none++; >@@ -80,6 +80,9 @@ main(argc, argv) > case 'c': > eflags |= VIS_CSTYLE; > break; >+ case 'h': >+ eflags |= VIS_HTTPSTYLE; >+ break; > case 't': > eflags |= VIS_TAB; > break; >@@ -132,9 +135,9 @@ static void > usage() > { > #ifdef DEBUG >- fprintf(stderr, "usage: vis [-cbflnostwd] [-F foldwidth] [file ...]\n"); >+ fprintf(stderr, "usage: vis [-chbflnostwd] [-F foldwidth] [file ...]\n"); > #else >- fprintf(stderr, "usage: vis [-cbflnostw] [-F foldwidth] [file ...]\n"); >+ fprintf(stderr, "usage: vis [-chbflnostw] [-F foldwidth] [file ...]\n"); > #endif > exit(1); > } >Index: unvis/unvis.1 >=================================================================== >RCS file: /home/ncvs/src/usr.bin/unvis/unvis.1,v >retrieving revision 1.6 >diff -u -p -r1.6 unvis.1 >--- unvis/unvis.1 2001/07/10 14:16:27 1.6 >+++ unvis/unvis.1 2002/04/25 01:22:15 >@@ -40,6 +40,7 @@ > .Nd "revert a visual representation of data back to original form" > .Sh SYNOPSIS > .Nm >+.Op Fl h > .Op Ar > .Sh DESCRIPTION > .Nm Unvis >@@ -47,6 +48,11 @@ is the inverse function of > .Xr vis 1 . > It reverts > a visual representation of data back to its original form on standard output. >+If the >+.Fl h >+option is specified, extra processing is done for HTTP-style URL >+encoding, as described in >+.Xr vis 1 . > .Sh SEE ALSO > .Xr vis 1 , > .Xr unvis 3 , >Index: unvis/unvis.c >=================================================================== >RCS file: /home/ncvs/src/usr.bin/unvis/unvis.c,v >retrieving revision 1.8 >diff -u -p -r1.8 unvis.c >--- unvis/unvis.c 2002/03/22 01:42:40 1.8 >+++ unvis/unvis.c 2002/04/25 01:22:16 >@@ -51,7 +51,7 @@ static const char rcsid[] = > #include <unistd.h> > #include <vis.h> > >-void process(FILE *, const char *); >+void process(FILE *, const char *, int); > static void usage(void); > > int >@@ -61,9 +61,13 @@ main(argc, argv) > { > FILE *fp; > int ch; >+ int flags = 0; > >- while ((ch = getopt(argc, argv, "")) != -1) >+ while ((ch = getopt(argc, argv, "h")) != -1) > switch((char)ch) { >+ case 'h': >+ flags |= VIS_HTTPSTYLE; >+ break; > case '?': > default: > usage(); >@@ -74,27 +78,28 @@ main(argc, argv) > if (*argv) > while (*argv) { > if ((fp=fopen(*argv, "r")) != NULL) >- process(fp, *argv); >+ process(fp, *argv, flags); > else > warn("%s", *argv); > argv++; > } > else >- process(stdin, "<stdin>"); >+ process(stdin, "<stdin>", flags); > exit(0); > } > > static void > usage() > { >- fprintf(stderr, "usage: unvis [file ...]\n"); >+ fprintf(stderr, "usage: unvis [-h] [file ...]\n"); > exit(1); > } > > void >-process(fp, filename) >+process(fp, filename, flags) > FILE *fp; > const char *filename; >+ int flags; > { > register int offset = 0, c, ret; > int state = 0; >@@ -103,7 +108,7 @@ process(fp, filename) > while ((c = getc(fp)) != EOF) { > offset++; > again: >- switch(ret = unvis(&outc, (char)c, &state, 0)) { >+ switch(ret = unvis(&outc, (char)c, &state, flags)) { > case UNVIS_VALID: > putchar(outc); > break; >@@ -121,6 +126,6 @@ process(fp, filename) > errx(1, "bad return value (%d), can't happen", ret); > } > } >- if (unvis(&outc, (char)0, &state, UNVIS_END) == UNVIS_VALID) >+ if (unvis(&outc, (char)0, &state, UNVIS_END | flags) == UNVIS_VALID) > putchar(outc); > }
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 37437
: 21345