diff options
author | Joe Mistachkin <joe@mistachkin.com> | 2008-06-13 05:45:01 (GMT) |
---|---|---|
committer | Joe Mistachkin <joe@mistachkin.com> | 2008-06-13 05:45:01 (GMT) |
commit | f7c3c0f0809266035acb3cdeaa624f903a3b0cf0 (patch) | |
tree | 32ea63055bc449e3ffe1e3b813bb8c48326ac84c /tools/man2tcl.c | |
parent | 9c5b16baabde8f28eb258e1b9be4727afa812830 (diff) | |
download | tcl-f7c3c0f0809266035acb3cdeaa624f903a3b0cf0.zip tcl-f7c3c0f0809266035acb3cdeaa624f903a3b0cf0.tar.gz tcl-f7c3c0f0809266035acb3cdeaa624f903a3b0cf0.tar.bz2 |
TIP 285 Implementation
Diffstat (limited to 'tools/man2tcl.c')
-rw-r--r-- | tools/man2tcl.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/man2tcl.c b/tools/man2tcl.c index 5743a73..6622a5b 100644 --- a/tools/man2tcl.c +++ b/tools/man2tcl.c @@ -15,7 +15,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: man2tcl.c,v 1.13 2007/12/13 15:28:40 dgp Exp $ + * RCS: @(#) $Id: man2tcl.c,v 1.14 2008/06/13 05:45:15 mistachkin Exp $ */ static char sccsid[] = "@(#) man2tcl.c 1.3 95/08/12 17:34:08"; @@ -197,6 +197,7 @@ DoMacro( * invocation. */ { char *p, *end; + int quote; /* * If there is no macro name, then just skip the whole line. @@ -234,8 +235,11 @@ DoMacro( } QuoteText(p+1, (end-(p+1))); } else { - for (end = p+1; (*end != 0) && !isspace(*end); end++) { - /* Empty loop body. */ + quote = 0; + for (end = p+1; (*end != 0) && (quote || !isspace(*end)); end++) { + if (*end == '\'') { + quote = !quote; + } } QuoteText(p, end-p); } @@ -346,7 +350,7 @@ DoText( p += 2; sscanf(p,"%d",&ch); - PRINT(("text \\u%04x", ch)); + PRINT(("text \\u%04x\n", ch)); while(*p&&*p!='\'') p++; } else if (*p != 0) { PRINT(("char {\\%c}\n", *p)); |