version 1.9, 2019/04/11 04:23:22 |
version 1.12, 2019/04/14 12:59:15 |
Line 112 macro_addarg(struct format *f, const char *arg, int fl |
|
Line 112 macro_addarg(struct format *f, const char *arg, int fl |
|
|
|
/* Escape us if we look like a macro. */ |
/* Escape us if we look like a macro. */ |
|
|
if ((flags & ARG_QUOTED) == 0 && |
if ((flags & (ARG_QUOTED | ARG_UPPER)) == 0 && |
(cp == arg || isspace((unsigned char)cp[-1])) && |
(cp == arg || isspace((unsigned char)cp[-1])) && |
isupper((unsigned char)cp[0]) && |
isupper((unsigned char)cp[0]) && |
islower((unsigned char)cp[1]) && |
islower((unsigned char)cp[1]) && |
(cp[2] == '\0' || cp[2] == ' ' || |
(cp[2] == '\0' || cp[2] == ' ' || |
(islower((unsigned char)cp[2]) && |
((cp[3] == '\0' || cp[3] == ' ') && |
(cp[3] == '\0' || cp[3] == ' ')))) |
(strncmp(cp, "Brq", 3) == 0 || |
|
strncmp(cp, "Bro", 3) == 0 || |
|
strncmp(cp, "Brc", 3) == 0 || |
|
strncmp(cp, "Bsx", 3) == 0)))) |
fputs("\\&", stdout); |
fputs("\\&", stdout); |
|
|
if (*cp == '"') |
if (*cp == '"') |
Line 212 macro_nodeline(struct format *f, const char *name, str |
|
Line 215 macro_nodeline(struct format *f, const char *name, str |
|
* line otherwise. The flag ARG_SPACE inserts spaces between words. |
* line otherwise. The flag ARG_SPACE inserts spaces between words. |
*/ |
*/ |
void |
void |
print_text(struct format *f, const char *word, int flags) { |
print_text(struct format *f, const char *word, int flags) |
|
{ |
switch (f->linestate) { |
switch (f->linestate) { |
case LINE_NEW: |
case LINE_NEW: |
break; |
break; |
Line 224 print_text(struct format *f, const char *word, int fla |
|
Line 228 print_text(struct format *f, const char *word, int fla |
|
macro_close(f); |
macro_close(f); |
break; |
break; |
} |
} |
fputs(word, stdout); |
if (f->linestate == LINE_NEW && (*word == '.' || *word == '\'')) |
|
fputs("\\&", stdout); |
|
while (*word != '\0') { |
|
putchar(*word); |
|
if (*word++ == '\\') |
|
putchar('e'); |
|
} |
f->linestate = LINE_TEXT; |
f->linestate = LINE_TEXT; |
f->flags = 0; |
f->flags = 0; |
} |
} |