modified traceback to deal with "inline" functions, i.e. blocks
[unix-history] / usr / src / old / dbx / scanner.c
index 2648a7e..740a069 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1982 Regents of the University of California */
 
 /* Copyright (c) 1982 Regents of the University of California */
 
-static char sccsid[] = "@(#)scanner.c 1.6 %G%";
+static char sccsid[] = "@(#)scanner.c 1.8 %G%";
 
 /*
  * Debugger scanner.
 
 /*
  * Debugger scanner.
@@ -106,7 +106,7 @@ public Token yylex()
     if (*p == '\0') {
        do {
            if (isterm(in)) {
     if (*p == '\0') {
        do {
            if (isterm(in)) {
-               printf("> ");
+               printf("(%s) ", cmdname);
                fflush(stdout);
            }
            line = fgets(linebuf, MAXLINESIZE, in);
                fflush(stdout);
            }
            line = fgets(linebuf, MAXLINESIZE, in);
@@ -445,6 +445,7 @@ private Token getstring()
                *q++ = *p;
            }
        } else {
                *q++ = *p;
            }
        } else {
+           curchar = p;
            *q++ = charcon(p);
            p = curchar;
        }
            *q++ = charcon(p);
            p = curchar;
        }
@@ -551,6 +552,7 @@ private Boolean eofinput()
     if (curinclindex == 0) {
        if (isterm(in)) {
            putchar('\n');
     if (curinclindex == 0) {
        if (isterm(in)) {
            putchar('\n');
+           clearerr(in);
            b = false;
        } else {
            b = true;
            b = false;
        } else {
            b = true;