? foo.sps
? getl_buf.patch
? junk.sps
? pspp.list
? doc/.dirstamp
? gl/.deps
? gl/Makefile
? gl/Makefile.am
? gl/Makefile.in
? gl/alloca.c
? gl/alloca.h
? gl/alloca_.h
? gl/asnprintf.c
? gl/asprintf.c
? gl/c-ctype.c
? gl/c-ctype.h
? gl/c-strtod.c
? gl/c-strtod.h
? gl/charset.alias
? gl/config.charset
? gl/configmake.h
? gl/error.c
? gl/error.h
? gl/exit.h
? gl/exitfail.c
? gl/exitfail.h
? gl/full-read.c
? gl/full-read.h
? gl/full-write.c
? gl/full-write.h
? gl/getdelim.c
? gl/getdelim.h
? gl/gethostname.c
? gl/getline.c
? gl/getline.h
? gl/getlogin_r.c
? gl/getlogin_r.h
? gl/getopt.c
? gl/getopt1.c
? gl/getopt_.h
? gl/getopt_int.h
? gl/gettext.h
? gl/intprops.h
? gl/lbrkprop.h
? gl/linebreak.c
? gl/linebreak.h
? gl/localcharset.c
? gl/localcharset.h
? gl/mbchar.c
? gl/mbchar.h
? gl/mbuiter.h
? gl/memcasecmp.c
? gl/memcasecmp.h
? gl/memchr.c
? gl/memcmp.c
? gl/memmem.c
? gl/memmem.h
? gl/memmove.c
? gl/memset.c
? gl/minmax.h
? gl/printf-args.c
? gl/printf-args.h
? gl/printf-parse.c
? gl/printf-parse.h
? gl/progname.c
? gl/progname.h
? gl/readlink.c
? gl/ref-add.sed
? gl/ref-add.sin
? gl/ref-del.sed
? gl/ref-del.sin
? gl/safe-read.c
? gl/safe-read.h
? gl/safe-write.c
? gl/safe-write.h
? gl/size_max.h
? gl/snprintf.c
? gl/snprintf.h
? gl/stat-macros.h
? gl/stdbool_.h
? gl/stdint.h
? gl/stdint_.h
? gl/stpcpy.c
? gl/stpcpy.h
? gl/strcase.h
? gl/strcasecmp.c
? gl/strcspn.c
? gl/strerror.c
? gl/strftime.c
? gl/strftime.h
? gl/strncasecmp.c
? gl/strndup.c
? gl/strndup.h
? gl/strnlen.c
? gl/strnlen.h
? gl/strnlen1.c
? gl/strnlen1.h
? gl/strpbrk.c
? gl/strpbrk.h
? gl/strsep.c
? gl/strsep.h
? gl/strstr.c
? gl/strstr.h
? gl/strtod.c
? gl/strtok_r.c
? gl/strtok_r.h
? gl/strtol.c
? gl/strtoul.c
? gl/time_r.c
? gl/time_r.h
? gl/utf16-ucs4.h
? gl/utf8-ucs4.h
? gl/vasnprintf.c
? gl/vasnprintf.h
? gl/vasprintf.c
? gl/vasprintf.h
? gl/vsnprintf.c
? gl/vsnprintf.h
? gl/wcwidth.h
? gl/xalloc-die.c
? gl/xalloc.h
? gl/xasprintf.c
? gl/xmalloc.c
? gl/xreadlink.c
? gl/xreadlink.h
? gl/xsize.h
? gl/xstrndup.c
? gl/xstrndup.h
? gl/xvasprintf.c
? gl/xvasprintf.h
? gl/m4/absolute-header.m4
? gl/m4/alloca.m4
? gl/m4/assert.m4
? gl/m4/c-strtod.m4
? gl/m4/codeset.m4
? gl/m4/eoverflow.m4
? gl/m4/error.m4
? gl/m4/exitfail.m4
? gl/m4/extensions.m4
? gl/m4/getdelim.m4
? gl/m4/gethostname.m4
? gl/m4/getline.m4
? gl/m4/getlogin_r.m4
? gl/m4/getopt.m4
? gl/m4/gettext.m4
? gl/m4/glibc2.m4
? gl/m4/glibc21.m4
? gl/m4/gnulib-cache.m4
? gl/m4/gnulib-comp.m4
? gl/m4/gnulib-tool.m4
? gl/m4/iconv.m4
? gl/m4/intdiv0.m4
? gl/m4/intmax.m4
? gl/m4/intmax_t.m4
? gl/m4/inttypes-h.m4
? gl/m4/inttypes-pri.m4
? gl/m4/inttypes_h.m4
? gl/m4/lcmessage.m4
? gl/m4/lib-ld.m4
? gl/m4/lib-link.m4
? gl/m4/lib-prefix.m4
? gl/m4/linebreak.m4
? gl/m4/localcharset.m4
? gl/m4/lock.m4
? gl/m4/longdouble.m4
? gl/m4/longlong.m4
? gl/m4/mbchar.m4
? gl/m4/mbiter.m4
? gl/m4/mbrtowc.m4
? gl/m4/mbstate_t.m4
? gl/m4/memcasecmp.m4
? gl/m4/memchr.m4
? gl/m4/memcmp.m4
? gl/m4/memmem.m4
? gl/m4/memmove.m4
? gl/m4/memset.m4
? gl/m4/minmax.m4
? gl/m4/nls.m4
? gl/m4/onceonly_2_57.m4
? gl/m4/po.m4
? gl/m4/printf-posix.m4
? gl/m4/progtest.m4
? gl/m4/readlink.m4
? gl/m4/safe-read.m4
? gl/m4/safe-write.m4
? gl/m4/signed.m4
? gl/m4/size_max.m4
? gl/m4/snprintf.m4
? gl/m4/ssize_t.m4
? gl/m4/stat-macros.m4
? gl/m4/stdarg.m4
? gl/m4/stdbool.m4
? gl/m4/stdint.m4
? gl/m4/stdint_h.m4
? gl/m4/stpcpy.m4
? gl/m4/strcase.m4
? gl/m4/strcspn.m4
? gl/m4/strerror.m4
? gl/m4/strftime.m4
? gl/m4/strndup.m4
? gl/m4/strnlen.m4
? gl/m4/strpbrk.m4
? gl/m4/strsep.m4
? gl/m4/strstr.m4
? gl/m4/strtod.m4
? gl/m4/strtok_r.m4
? gl/m4/strtol.m4
? gl/m4/strtoul.m4
? gl/m4/time_r.m4
? gl/m4/tm_gmtoff.m4
? gl/m4/uintmax_t.m4
? gl/m4/ulonglong.m4
? gl/m4/unistd_h.m4
? gl/m4/utf-ucs4.m4
? gl/m4/vasnprintf.m4
? gl/m4/vasprintf.m4
? gl/m4/visibility.m4
? gl/m4/vsnprintf.m4
? gl/m4/wchar_t.m4
? gl/m4/wcwidth.m4
? gl/m4/wint_t.m4
? gl/m4/xalloc.m4
? gl/m4/xreadlink.m4
? gl/m4/xsize.m4
? gl/m4/xstrndup.m4
? gl/m4/xvasprintf.m4
? intl/ChangeLog
? intl/Makefile
? intl/Makefile.in
? intl/VERSION
? intl/bindtextdom.c
? intl/config.charset
? intl/dcgettext.c
? intl/dcigettext.c
? intl/dcngettext.c
? intl/dgettext.c
? intl/dngettext.c
? intl/eval-plural.h
? intl/explodename.c
? intl/finddomain.c
? intl/gettext.c
? intl/gettextP.h
? intl/gmo.h
? intl/hash-string.h
? intl/intl-compat.c
? intl/l10nflist.c
? intl/langprefs.c
? intl/libgnuintl.h.in
? intl/loadinfo.h
? intl/loadmsgcat.c
? intl/localcharset.c
? intl/localcharset.h
? intl/locale.alias
? intl/localealias.c
? intl/localename.c
? intl/log.c
? intl/ngettext.c
? intl/os2compat.c
? intl/os2compat.h
? intl/osdep.c
? intl/plural-exp.c
? intl/plural-exp.h
? intl/plural.c
? intl/plural.y
? intl/printf-args.c
? intl/printf-args.h
? intl/printf-parse.c
? intl/printf-parse.h
? intl/printf.c
? intl/ref-add.sin
? intl/ref-del.sin
? intl/relocatable.c
? intl/relocatable.h
? intl/textdomain.c
? intl/vasnprintf.c
? intl/vasnprintf.h
? intl/vasnwprintf.h
? intl/wprintf-parse.h
? intl/xsize.h
? lib/gsl-extras/.deps
? lib/gsl-extras/.dirstamp
? lib/gtksheet/.deps
? lib/gtksheet/.dirstamp
? lib/linreg/.deps
? lib/linreg/.dirstamp
? m4/Makefile.am
? m4/codeset.m4
? m4/gettext.m4
? m4/glibc2.m4
? m4/glibc21.m4
? m4/iconv.m4
? m4/intdiv0.m4
? m4/intmax.m4
? m4/inttypes-pri.m4
? m4/inttypes.m4
? m4/inttypes_h.m4
? m4/isc-posix.m4
? m4/lcmessage.m4
? m4/lib-ld.m4
? m4/lib-link.m4
? m4/lib-prefix.m4
? m4/longdouble.m4
? m4/longlong.m4
? m4/nls.m4
? m4/po.m4
? m4/printf-posix.m4
? m4/progtest.m4
? m4/signed.m4
? m4/size_max.m4
? m4/stdint_h.m4
? m4/uintmax_t.m4
? m4/ulonglong.m4
? m4/wchar_t.m4
? m4/wint_t.m4
? m4/xsize.m4
? src/data/.deps
? src/data/.dirstamp
? src/language/.deps
? src/language/.dirstamp
? src/language/control/.deps
? src/language/control/.dirstamp
? src/language/data-io/.deps
? src/language/data-io/.dirstamp
? src/language/data-io/file-handle.c
? src/language/data-io/list.c
? src/language/dictionary/.deps
? src/language/dictionary/.dirstamp
? src/language/expressions/.deps
? src/language/expressions/.dirstamp
? src/language/lexer/.deps
? src/language/lexer/.dirstamp
? src/language/lexer/q2c
? src/language/stats/.deps
? src/language/stats/.dirstamp
? src/language/stats/correlations.c
? src/language/stats/crosstabs.c
? src/language/stats/examine.c
? src/language/stats/frequencies.c
? src/language/stats/means.c
? src/language/stats/oneway.c
? src/language/stats/rank.c
? src/language/stats/regression.c
? src/language/stats/t-test.c
? src/language/tests/.deps
? src/language/tests/.dirstamp
? src/language/utilities/.deps
? src/language/utilities/.dirstamp
? src/language/utilities/set.c
? src/language/xforms/.deps
? src/language/xforms/.dirstamp
? src/libpspp/.deps
? src/libpspp/.dirstamp
? src/libpspp/version.c
? src/math/.deps
? src/math/.dirstamp
? src/math/linreg/.deps
? src/math/linreg/.dirstamp
? src/math/ts/.deps
? src/math/ts/.dirstamp
? src/output/.deps
? src/output/.dirstamp
? src/output/charts/.deps
? src/output/charts/.dirstamp
? src/ui/.deps
? src/ui/.dirstamp
? src/ui/gui/.deps
? src/ui/gui/.dirstamp
? src/ui/gui/psppire
? src/ui/terminal/.deps
? src/ui/terminal/.dirstamp
? src/ui/terminal/pspp
? tests/libpspp/.deps
? tests/libpspp/.dirstamp
? tests/libpspp/ll-test
? tests/libpspp/llx-test
Index: src/language/line-buffer.c
===================================================================
RCS file: /sources/pspp/pspp/src/language/line-buffer.c,v
retrieving revision 1.15
diff -b -w -U3 -r1.15 line-buffer.c
--- src/language/line-buffer.c	8 Jul 2006 03:05:51 -0000	1.15
+++ src/language/line-buffer.c	26 Oct 2006 08:13:18 -0000
@@ -98,7 +98,6 @@
 
 static struct string getl_include_path;
 
-struct string getl_buf;
 
 static void close_source (void);
 
@@ -106,16 +105,17 @@
 static void uninit_prompts (void);
 static enum getl_prompt_style get_prompt_style (void);
 
+
 /* Initialize getl. */
 void
 getl_initialize (void)
 {
   ds_init_cstr (&getl_include_path,
                 fn_getenv_default ("STAT_INCLUDE_PATH", include_path));
-  ds_init_empty (&getl_buf);
   init_prompts ();
 }
 
+
 /* Delete everything from the include path. */
 void
 getl_clear_include_path (void)
@@ -387,7 +387,6 @@
 {
   while (cur_source != NULL)
     close_source ();
-  ds_destroy (&getl_buf);
   ds_destroy (&getl_include_path);
   free(file_loc);
   file_loc = NULL;
@@ -502,7 +501,7 @@
    If INTERACTIVE is non-null, then when true is returned
    *INTERACTIVE will be set to true if the line was obtained
    interactively, false otherwise. */
-static bool
+bool
 do_read_line (struct string *line, bool *interactive)
 {
   while (cur_source != NULL)
@@ -525,16 +524,6 @@
   return false;
 }
 
-/* Reads a single line into getl_buf.
-   Returns true when a line has been read, false at end of input.
-   If INTERACTIVE is non-null, then when true is returned
-   *INTERACTIVE will be set to true if the line was obtained
-   interactively, false otherwise. */
-bool
-getl_read_line (bool *interactive)
-{
-  return do_read_line (&getl_buf, interactive);
-}
 
 /* Current prompts in each style. */
 static char *prompts[GETL_PROMPT_CNT];
Index: src/language/line-buffer.h
===================================================================
RCS file: /sources/pspp/pspp/src/language/line-buffer.h,v
retrieving revision 1.5
diff -b -w -U3 -r1.5 line-buffer.h
--- src/language/line-buffer.h	10 Jul 2006 09:28:14 -0000	1.5
+++ src/language/line-buffer.h	26 Oct 2006 08:13:18 -0000
@@ -31,9 +31,6 @@
     GETL_PROMPT_CNT
   };
 
-/* Current line.  This line may be modified by modules other than
-   getl.c, and by lexer.c in particular.  (Ugh.) */
-extern struct string getl_buf;
 
 void getl_initialize (void);
 void getl_uninitialize (void);
@@ -66,5 +63,7 @@
 
 void getl_location (const char **fn, int *ln);
 
+bool do_read_line (struct string *line, bool *interactive);
+
 
 #endif /* line-buffer.h */
Index: src/language/control/repeat.c
===================================================================
RCS file: /sources/pspp/pspp/src/language/control/repeat.c,v
retrieving revision 1.13
diff -b -w -U3 -r1.13 repeat.c
--- src/language/control/repeat.c	26 Oct 2006 06:16:36 -0000	1.13
+++ src/language/control/repeat.c	26 Oct 2006 08:13:18 -0000
@@ -281,9 +281,10 @@
       const char *cur_file_name;
       int cur_line_number;
       struct line_list *line;
+      struct string cur_line_copy;
       bool dot;
 
-      if (!getl_read_line (NULL))
+      if (! lex_get_line_raw ())
         return false;
 
       /* If the current file has changed then record the fact. */
@@ -292,27 +293,32 @@
           || !strcmp (cur_file_name, previous_file_name))
         previous_file_name = pool_strdup (block->pool, cur_file_name);
 
-      ds_rtrim (&getl_buf, ss_cstr (CC_SPACES));
-      dot = ds_chomp (&getl_buf, get_endcmd ());
-      if (recognize_do_repeat (ds_cstr (&getl_buf))) 
+      ds_init_string (&cur_line_copy, lex_entire_line_ds () );
+      ds_rtrim (&cur_line_copy, ss_cstr (CC_SPACES));
+      dot = ds_chomp (&cur_line_copy, get_endcmd ());
+
+      if (recognize_do_repeat (ds_cstr (&cur_line_copy)))
         nesting_level++; 
-      else if (recognize_end_repeat (ds_cstr (&getl_buf), &block->print)) 
+      else if (recognize_end_repeat (ds_cstr (&cur_line_copy), &block->print)) 
         {
         if (nesting_level-- == 0)
           {
             lex_discard_line ();
+	    ds_destroy (&cur_line_copy);
             return true;
           } 
         }
       if (dot)
-        ds_put_char (&getl_buf, get_endcmd ());
+        ds_put_char (&cur_line_copy, get_endcmd ());
       
       line = *last_line = pool_alloc (block->pool, sizeof *line);
       line->next = NULL;
       line->file_name = previous_file_name;
       line->line_number = cur_line_number;
-      line->line = pool_strdup (block->pool, ds_cstr (&getl_buf));
+      line->line = pool_strdup (block->pool, ds_cstr (&cur_line_copy) );
       last_line = &line->next;
+
+      ds_destroy (&cur_line_copy);
     }
 
   lex_discard_line ();
@@ -463,7 +469,8 @@
   return NULL;
 }
 
-/* Makes appropriate DO REPEAT macro substitutions within getl_buf. */
+/* Makes appropriate DO REPEAT macro substitutions within the 
+   repeated lines. */
 static void
 do_repeat_filter (struct string *line, void *block_)
 {
Index: src/language/data-io/data-reader.c
===================================================================
RCS file: /sources/pspp/pspp/src/language/data-io/data-reader.c,v
retrieving revision 1.14
diff -b -w -U3 -r1.14 data-reader.c
--- src/language/data-io/data-reader.c	26 Oct 2006 06:16:36 -0000	1.14
+++ src/language/data-io/data-reader.c	26 Oct 2006 08:13:19 -0000
@@ -170,7 +170,7 @@
       getl_set_prompt_style (GETL_PROMPT_DATA);
     }
       
-  if (!getl_read_line (NULL))
+  if (!lex_get_line_raw ())
     {
       msg (SE, _("Unexpected end-of-file while reading data in BEGIN "
                  "DATA.  This probably indicates "
@@ -180,14 +180,15 @@
       return false;
     }
 
-  if (ds_length (&getl_buf) >= 8
-      && !strncasecmp (ds_cstr (&getl_buf), "end data", 8))
+  if (ds_length (lex_entire_line_ds() ) >= 8
+      && !strncasecmp (lex_entire_line (), "end data", 8))
     {
-      lex_set_prog (ds_end (&getl_buf));
+      lex_discard_line ();
       return false;
     }
 
-  ds_assign_string (&r->line, &getl_buf);
+  ds_assign_string (&r->line, lex_entire_line_ds () );
+
   return true;
 }
 
Index: src/language/lexer/lexer.c
===================================================================
RCS file: /sources/pspp/pspp/src/language/lexer/lexer.c,v
retrieving revision 1.9
diff -b -w -U3 -r1.9 lexer.c
--- src/language/lexer/lexer.c	20 Oct 2006 11:32:57 -0000	1.9
+++ src/language/lexer/lexer.c	26 Oct 2006 08:13:19 -0000
@@ -61,7 +61,7 @@
 
 /* Static variables. */
 
-/* Pointer to next token in getl_buf. */
+/* Pointer to next token in line_buffer. */
 static char *prog;
 
 /* True only if this line ends with a terminal dot. */
@@ -95,12 +95,19 @@
 
 /* Initialization. */
 
+static struct string line_buffer;
+
+static bool (*lex_read_line) (struct string *, bool *);
+
 /* Initializes the lexer. */
 void
-lex_init (void)
+lex_init (bool (*read_line_func) (struct string *, bool *))
 {
   ds_init_empty (&tokstr);
   ds_init_empty (&put_tokstr);
+  ds_init_empty (&line_buffer);
+  lex_read_line = read_line_func;
+
   if (!lex_get_line ())
     eof = true;
 }
@@ -110,6 +117,7 @@
 {
   ds_destroy (&put_tokstr);
   ds_destroy (&tokstr);
+  ds_destroy (&line_buffer);
 }
 
 
@@ -700,7 +708,13 @@
 const char *
 lex_entire_line (void)
 {
-  return ds_cstr (&getl_buf);
+  return ds_cstr (&line_buffer);
+}
+
+const struct string *
+lex_entire_line_ds (void)
+{
+  return &line_buffer;
 }
 
 /* As lex_entire_line(), but only returns the part of the current line
@@ -720,18 +734,12 @@
 void
 lex_discard_line (void)
 {
-  prog = ds_end (&getl_buf);
+  ds_cstr (&line_buffer);  /* Ensures ds_end points to something valid */
+  prog = ds_end (&line_buffer);
   dot = false;
   put_token = 0;
 }
 
-/* Sets the current position in the current line to P, which must be
-   in getl_buf. */
-void
-lex_set_prog (char *p)
-{
-  prog = p;
-}
 
 /* Discards the rest of the current command.
    When we're reading commands from a file, we skip tokens until
@@ -802,16 +810,24 @@
     }
 }
 
+/* Reads a line, without performing any preprocessing */
+bool 
+lex_get_line_raw (void)
+{
+  bool dummy;
+  return lex_read_line (&line_buffer, &dummy);
+}
+
 /* Reads a line for use by the tokenizer, and preprocesses it by
    removing comments, stripping trailing whitespace and the
    terminal dot, and removing leading indentors. */
 bool
 lex_get_line (void)
 {
-  struct string *line = &getl_buf;
+  struct string *line = &line_buffer;
   bool interactive;
 
-  if (!getl_read_line (&interactive))
+  if (!lex_read_line (line, &interactive))
     return false;
 
   strip_comments (line);
@@ -976,7 +992,8 @@
       if (put_token == '.')
 	break;
 
-      prog = ds_end (&getl_buf);
+      ds_cstr (&line_buffer); /* Ensures ds_end will point to a valid char */
+      prog = ds_end (&line_buffer);
       if (dot)
 	break;
     }
Index: src/language/lexer/lexer.h
===================================================================
RCS file: /sources/pspp/pspp/src/language/lexer/lexer.h,v
retrieving revision 1.6
diff -b -w -U3 -r1.6 lexer.h
--- src/language/lexer/lexer.h	14 Oct 2006 00:25:20 -0000	1.6
+++ src/language/lexer/lexer.h	26 Oct 2006 08:13:19 -0000
@@ -35,7 +35,7 @@
 #include <stddef.h>
 
 /* Initialization. */
-void lex_init (void);
+void lex_init (bool (*)(struct string *, bool*));
 void lex_done (void);
 
 /* Common functions. */
@@ -71,13 +71,14 @@
 
 /* Weird line processing functions. */
 const char *lex_entire_line (void);
+const struct string *lex_entire_line_ds (void);
 const char *lex_rest_of_line (int *end_dot);
 void lex_discard_line (void);
-void lex_set_prog (char *p);
 void lex_discard_rest_of_command (void);
 
 /* Weird line reading functions. */
 bool lex_get_line (void);
+bool lex_get_line_raw (void);
 
 /* Token names. */
 const char *lex_token_name (int);
Index: src/ui/terminal/main.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/terminal/main.c,v
retrieving revision 1.16
diff -b -w -U3 -r1.16 main.c
--- src/ui/terminal/main.c	26 Oct 2006 06:16:36 -0000	1.16
+++ src/ui/terminal/main.c	26 Oct 2006 08:13:19 -0000
@@ -100,7 +100,7 @@
   if (parse_command_line (argc, argv)) 
     {
       outp_read_devices ();
-      lex_init ();
+      lex_init (do_read_line);
 
       for (;;)
         {
Index: tests/command/do-repeat.sh
===================================================================
RCS file: /sources/pspp/pspp/tests/command/do-repeat.sh,v
retrieving revision 1.3
diff -b -w -U3 -r1.3 do-repeat.sh
--- tests/command/do-repeat.sh	8 May 2006 01:16:40 -0000	1.3
+++ tests/command/do-repeat.sh	26 Oct 2006 08:13:19 -0000
@@ -66,9 +66,9 @@
 
 VECTOR v(6).
 COMPUTE #idx = 0.
-DO REPEAT a = 1 TO 2.
-	DO REPEAT b = 3 TO 5.
-		COMPUTE #x = a + b.
+DO REPEAT i = 1 TO 2.
+	DO REPEAT j = 3 TO 5.
+		COMPUTE #x = i + j.
 		COMPUTE #idx = #idx + 1.
 		COMPUTE v(#idx) = #x.
 	END REPEAT.
@@ -80,7 +80,7 @@
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="run program"
-$SUPERVISOR $PSPP --testing-mode -o raw-ascii $TESTFILE >/dev/null 2>&1
+$SUPERVISOR $PSPP --testing-mode -o raw-ascii $TESTFILE 
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="compare results"
