summaryrefslogtreecommitdiff
path: root/quote.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-06-02 13:59:09 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-06-02 13:59:09 -0700
commitfbdd36cf72165d552692d7f9793cdb826b1ad001 (patch)
treef4a812ad7571d47c89b8ebe52ff115584f1bbaae /quote.c
parent2dff954903822df000a018e953c479d9c9a9c9f0 (diff)
downloadnasm-fbdd36cf72165d552692d7f9793cdb826b1ad001.tar.gz
nasm-fbdd36cf72165d552692d7f9793cdb826b1ad001.tar.bz2
nasm-fbdd36cf72165d552692d7f9793cdb826b1ad001.zip
quote: Change the definition of escp
Semi-arbitrary change of the definition of escp to the beginning of the argument sequence instead of the initiator character. This may avoid an add in some code paths, and looks slightly cleaner to me.
Diffstat (limited to 'quote.c')
-rw-r--r--quote.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/quote.c b/quote.c
index d7a8dd7..6bfded3 100644
--- a/quote.c
+++ b/quote.c
@@ -232,7 +232,7 @@ size_t nasm_unquote(char *str)
case st_backslash:
state = st_start;
- escp = p-1;
+ escp = p; /* Beginning of argument sequence */
nval = 0;
switch (c) {
case 'a':
@@ -315,7 +315,7 @@ size_t nasm_unquote(char *str)
}
} else {
p--; /* Process this character again */
- *q++ = (p > escp+1) ? nval : *escp;
+ *q++ = (p > escp) ? nval : escp[-1];
state = st_start;
}
break;
@@ -331,10 +331,10 @@ size_t nasm_unquote(char *str)
}
} else {
p--; /* Process this character again */
- if (p > escp+1)
+ if (p > escp)
q = emit_utf8(q, nval);
else
- *q++ = *escp;
+ *q++ = escp[-1];
state = st_start;
}
break;
@@ -348,13 +348,13 @@ size_t nasm_unquote(char *str)
*q++ = nval;
break;
case st_hex:
- *q++ = (p > escp+1) ? nval : *escp;
+ *q++ = (p > escp) ? nval : escp[-1];
break;
case st_ucs:
- if (p > escp+1)
+ if (p > escp)
q = emit_utf8(q, nval);
else
- *q++ = *escp;
+ *q++ = escp[-1];
break;
}
*q = '\0';