summaryrefslogtreecommitdiffstats
path: root/tools/man2tcl.c
diff options
context:
space:
mode:
authorJoe Mistachkin <joe@mistachkin.com>2008-10-02 18:56:30 (GMT)
committerJoe Mistachkin <joe@mistachkin.com>2008-10-02 18:56:30 (GMT)
commit6baa5b8d5a6b70470cad4964945c2027b381011f (patch)
treec053bfea326d04e1cd71e9ae0950c5b88d75777a /tools/man2tcl.c
parentff519c460e7cc2818e6c0fdaa9469f6de154659b (diff)
downloadtcl-6baa5b8d5a6b70470cad4964945c2027b381011f.zip
tcl-6baa5b8d5a6b70470cad4964945c2027b381011f.tar.gz
tcl-6baa5b8d5a6b70470cad4964945c2027b381011f.tar.bz2
Fixes for [Bug 1934200, 1934272]
Diffstat (limited to 'tools/man2tcl.c')
-rw-r--r--tools/man2tcl.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/man2tcl.c b/tools/man2tcl.c
index 5743a73..efcbe2b 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.13.2.1 2008/10/02 18:56:30 mistachkin Exp $
*/
static char sccsid[] = "@(#) man2tcl.c 1.3 95/08/12 17:34:08";
@@ -96,7 +96,7 @@ main(
char **argv) /* Values of command-line arguments. */
{
FILE *f;
-#define MAX_LINE_SIZE 1000
+#define MAX_LINE_SIZE 4000
char line[MAX_LINE_SIZE];
char *p;
@@ -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));