Skip to contentSkip to conversation

parser: Use USTPUTC in parsebackq

PATCH New Herbert Xu 1 participant 1 message Jun 7

lore
Share & tools
lore

Herbert Xu

author
#0 lore raw

PATCH 1/1 parser: Use USTPUTC in parsebackq

Move the CHECKSTRSPACE call out and replace STPUTC with USTPUTC in parsebackq.

src/parser.c +3 -3
index 412e876..c69e0fb 100644
@@ -1539,6 +1539,7 @@ parsebackq: {
                 int pc;
 
 		while (!done) {
+			CHECKSTRSPACE(MB_LEN_MAX + 1, pout);
 			if (needprompt) {
 				setprompt(2);
 			}
@@ -1551,8 +1552,7 @@ parsebackq: {
                                 pc = pgetc();
                                 if (pc != '\\' && pc != '`' && pc != '$'
                                     && (!synstack->dblquote || pc != '"'))
-                                        STPUTC('\\', pout);
-				CHECKSTRSPACE(MB_LEN_MAX, pout);
+                                        USTPUTC('\\', pout);
 				ml = getmbc(pc, pout, 2);
 				pout += ml;
 				if (ml)
@@ -1569,7 +1569,7 @@ parsebackq: {
 			default:
 				break;
 			}
-			STPUTC(pc, pout);
+			USTPUTC(pc, pout);
                 }
 		if (chkeofmark) {
 			out = pout;
Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt