--- rdorch.c-orig Mon May 18 02:22:54 1998 +++ rdorch.c Tue Jul 7 01:27:22 1998 @@ -1,6 +1,14 @@ #include "cs.h" /* RDORCH.C */ #include + /* Modification of backslash line-extender + * system so it does not operate if the char + * immediately following is printable and not + * a ";", or "/". See label keep_backslash. + * + * Robin Whittle 7 July 1998. + */ + #ifdef DOSGCC #include #endif @@ -249,12 +257,45 @@ } } } - else { /* Error here */ + else { /* We arrive here because a + * backslash was found, but not + * followed by a new-line, ";" + * or "/" comment - after any + * whitespace was skipped. + * Rather than continue as if + * this is a line-continue + * situation, we assume that + * whoever wrote the .orc file + * actually wanted a backslash + * here - perhaps as part of + * a quoted string of some kind. + * + * The following code works if + * the backslash is immediately + * followed by a printable + * character that we want to + * retain. That character has + * been read into c by the test + * above for whitespace. + * We want to keep it, so we + * write it to the output buffer + * and skip over the lines below + * which implement the line + * continuation actions. + * + * The original comment at this + * place said: + */ + /* Error here */ + *cp++ = c; + goto keep_backslash; + } *(cp-1) = ' '; srccnt++; /* record a fakeline */ srclin[++lincnt] = 0; linadr[lincnt] = cp; + keep_backslash: } else if (c == '\n') { /* at each new line */ char *lp = linadr[lincnt];