* top.c (command_line_input): Only strip out an initial #-comment.
authorPer Bothner <per@bothner.com>
Wed, 29 Nov 1995 23:22:32 +0000 (23:22 +0000)
committerPer Bothner <per@bothner.com>
Wed, 29 Nov 1995 23:22:32 +0000 (23:22 +0000)
Looking for internal comments is language-specific (breaks Scheme).

gdb/ChangeLog
gdb/top.c

index 1e2654a7c40aaf7a511afe9558be2d81a0769b47..f15444a5701e0d20d8c225c55d1004851408e142 100644 (file)
@@ -1,5 +1,8 @@
 Wed Nov 29 13:35:18 1995  Per Bothner  <bothner@kalessin.cygnus.com>
 
+       * top.c (command_line_input):  Only strip out an initial #-comment.
+       Looking for internal comments is language-specific (breaks Scheme).
+       
        * expression.h (enum exp_opcode):  Add BINOP_RANGE.
        * expprint.c (dump_expression):  Support BINOP_RANGE.
        * eval.c (evaluate_subexp_standard):  Handle BINOP_RANGE (as error).
index 7f2c8a416f1c81e01f3f76de2b36a6ef927ca529..09db23862df2a1ca3dc3fefca24c71295bbb9b29 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -2041,16 +2041,11 @@ command_line_input (prrompt, repeat, annotation_suffix)
   /* If we just got an empty line, and that is supposed
      to repeat the previous command, return the value in the
      global buffer.  */
-  if (repeat)
-    {
-      if (p == linebuffer)
-       return line;
-      p1 = linebuffer;
-      while (*p1 == ' ' || *p1 == '\t')
-       p1++;
-      if (!*p1)
-       return line;
-    }
+  if (repeat && p == linebuffer)
+    return line;
+  for (p1 = linebuffer; *p1 == ' ' || *p1 == '\t'; p1++) ;
+  if (repeat && !*p1)
+    return line;
 
   *p = 0;
 
@@ -2065,36 +2060,8 @@ command_line_input (prrompt, repeat, annotation_suffix)
      out the command and then later fetch it from the value history
      and remove the '#'.  The kill ring is probably better, but some
      people are in the habit of commenting things out.  */
-  p1 = linebuffer;
-  while ((c = *p1++) != '\0')
-    {
-      if (c == '"')
-       while ((c = *p1++) != '"')
-         {
-           /* Make sure an escaped '"' doesn't make us think the string
-              is ended.  */
-           if (c == '\\')
-             parse_escape (&p1);
-           if (c == '\0')
-             break;
-         }
-      else if (c == '\'')
-       while ((c = *p1++) != '\'')
-         {
-           /* Make sure an escaped '\'' doesn't make us think the string
-              is ended.  */
-           if (c == '\\')
-             parse_escape (&p1);
-           if (c == '\0')
-             break;
-         }
-      else if (c == '#')
-       {
-         /* Found a comment.  */
-         p1[-1] = '\0';
-         break;
-       }
-    }
+  if (*p1 == '#')
+    *p1 = '\0';  /* Found a comment. */
 
   /* Save into global buffer if appropriate.  */
   if (repeat)
This page took 0.030943 seconds and 4 git commands to generate.