234 |
|
|
235 |
j = 0; |
j = 0; |
236 |
for (i = 0; i < nsyms; i++) |
for (i = 0; i < nsyms; i++) |
|
/* this used to be i<=nsyms, but that output a final "" symbol |
|
|
almost by accident */ |
|
237 |
{ |
{ |
238 |
|
/* Be sure not to use twice the same quotearg slot. */ |
239 |
|
const char *cp = |
240 |
|
quotearg_n_style (1, c_quoting_style, |
241 |
|
quotearg_style (escape_quoting_style, tags[i])); |
242 |
/* Width of the next token, including the two quotes, the coma |
/* Width of the next token, including the two quotes, the coma |
243 |
and the space. */ |
and the space. */ |
244 |
int strsize = 4; |
int strsize = strlen (cp) + 2; |
|
char *p; |
|
|
|
|
|
for (p = tags[i]; p && *p; p++) |
|
|
if (*p == '"' || *p == '\\' || *p == '\n' || *p == '\t' |
|
|
|| *p == '\b') |
|
|
strsize += 2; |
|
|
else if (*p < 040 || *p >= 0177) |
|
|
strsize += 4; |
|
|
else |
|
|
strsize++; |
|
245 |
|
|
246 |
if (j + strsize > 75) |
if (j + strsize > 75) |
247 |
{ |
{ |
249 |
j = 2; |
j = 2; |
250 |
} |
} |
251 |
|
|
252 |
obstack_1grow (&output_obstack, '\"'); |
obstack_sgrow (&output_obstack, cp); |
253 |
for (p = tags[i]; p && *p; p++) |
obstack_sgrow (&output_obstack, ", "); |
|
{ |
|
|
if (*p == '"' || *p == '\\') |
|
|
obstack_fgrow1 (&output_obstack, "\\%c", *p); |
|
|
else if (*p == '\n') |
|
|
obstack_sgrow (&output_obstack, "\\n"); |
|
|
else if (*p == '\t') |
|
|
obstack_sgrow (&output_obstack, "\\t"); |
|
|
else if (*p == '\b') |
|
|
obstack_sgrow (&output_obstack, "\\b"); |
|
|
else if (*p < 040 || *p >= 0177) |
|
|
obstack_fgrow1 (&output_obstack, "\\%03o", *p); |
|
|
else |
|
|
obstack_1grow (&output_obstack, *p); |
|
|
} |
|
|
|
|
|
obstack_sgrow (&output_obstack, "\", "); |
|
254 |
j += strsize; |
j += strsize; |
255 |
} |
} |
256 |
/* add a NULL entry to list of tokens */ |
/* add a NULL entry to list of tokens */ |