\S{strcat} \i{Concatenating Strings}: \i\c{%strcat}
-The \{%strcat} operator concatenates quoted strings and assign them to
+The \c{%strcat} operator concatenates quoted strings and assign them to
a single-line macro. In doing so, it may change the type of quotes
-and possibly use \c{\}-escapes inside \c{`}-quoted strings in order to
+and possibly use \c{\\}-escapes inside \c{`}-quoted strings in order to
make sure the string is still a valid quoted string.
For example:
... would assign the value \c{`"'`} to \c{beta}.
-The use of commas to separate strings are permitted but optional.
+The use of commas to separate strings is permitted but optional.
\S{strlen} \i{String Length}: \i\c{%strlen}
\S{ifctx} \i\c{%ifctx}: Testing the Context Stack\I{testing, context
stack}
-The conditional-assembly construct \c{%ifctx ctxname} will cause the
+The conditional-assembly construct \c{%ifctx} will cause the
subsequent code to be assembled if and only if the top context on
-the preprocessor's context stack has the name \c{ctxname}. As with
-\c{%ifdef}, the inverse and \c{%elif} forms \i\c{%ifnctx},
+the preprocessor's context stack has the same name as one of the arguments.
+As with \c{%ifdef}, the inverse and \c{%elif} forms \i\c{%ifnctx},
\i\c{%elifctx} and \i\c{%elifnctx} are also supported.
For more details of the context stack, see \k{ctxstack}. For a
switch (i) {
case PPC_IFCTX:
j = false; /* have we matched yet? */
- while (cstk && tline) {
+ while (true) {
skip_white_(tline);
- if (!tline || tline->type != TOK_ID) {
+ if (!tline)
+ break;
+ if (tline->type != TOK_ID) {
error(ERR_NONFATAL,
"`%s' expects context identifiers", pp_directives[ct]);
free_tlist(origline);
return -1;
}
- if (cstk->name && !nasm_stricmp(tline->text, cstk->name))
+ if (cstk && cstk->name && !nasm_stricmp(tline->text, cstk->name))
j = true;
tline = tline->next;
}