Ilya Zakharevich on Sun, 27 Oct 2002 14:45:21 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PATCH] more readline= cleanups


The parsing of .gprc was wrong (one could not put readline=0 line
there).  [I do not enforce the documented format of `read' command.
Should not we?]

My patch for readline flags was wrong (I forgot to update the upper
limit from 3 to 7 when I added another meaningful bit 0x4).

Enjoy,
Ilya

--- ./src/gp/gp.c-prex	Thu Oct 17 02:51:42 2002
+++ ./src/gp/gp.c	Sun Oct 27 14:27:32 2002
@@ -655,7 +655,7 @@ sd_rl(char *v, int flag)
     readline_init = 1;
   }
   o_readline_state = readline_state;
-  res = sd_ulong(v,flag,"readline", &readline_state, 0, 3, (char**)msg);
+  res = sd_ulong(v,flag,"readline", &readline_state, 0, 7, (char**)msg);
   if (o_readline_state != readline_state)
     sd_gptoggle(readline_state ? "1" : "0", d_SILENT, "readline", USE_READLINE);
   return res;
@@ -2088,7 +2088,7 @@ gp_initrc(void)
     for ( ; *s; s = nexts)
     {
       nexts = next_expr(s);
-      if (!strncmp(s,"read",4))
+      if (!strncmp(s,"read",4) && (s[4] == ' ' || s[4] == '\t' || s[4] == '"'))
       { /* read file */
 	s += 4;
 	t = gpmalloc(strlen(s) + 1);