diff src/parse.y @ 3427:e098ebb77023

[project @ 2000-01-13 09:25:53 by jwe]
author jwe
date Thu, 13 Jan 2000 09:25:59 +0000
parents 42cb61dd0248
children 5ee5afb3981a
line wrap: on
line diff
--- a/src/parse.y	Thu Jan 13 08:40:53 2000 +0000
+++ b/src/parse.y	Thu Jan 13 09:25:59 2000 +0000
@@ -2718,9 +2718,9 @@
 {
   bool retval = false;
 
-  string t = s.substr (0, 15);
-
-  if (t == " Copyright (C) ")
+  string t = s.substr (0, 14);
+
+  if (t == "Copyright (C) ")
     {
       size_t pos = s.find ('\n');
 
@@ -2732,10 +2732,10 @@
 	    {
 	      pos++;
 
-	      t = s.substr (pos, 29);
-
-	      if (t == " This file is part of Octave."
-		  || t == " This program is free softwar")
+	      t = s.substr (pos, 28);
+
+	      if (t == "This file is part of Octave."
+		  || t == "This program is free softwar")
 		retval = true;
 	    }
 	}
@@ -2762,6 +2762,7 @@
   bool begin_comment = false;
   bool have_help_text = false;
   bool in_comment = false;
+  bool discard_space = true;
   int c;
 
   while ((c = getc (ffile)) != EOF)
@@ -2773,6 +2774,11 @@
 	{
 	  if (c == '%' || c == '#')
 	    continue;
+	  else if (discard_space && c == ' ')
+	    {
+	      discard_space = false;
+	      continue;
+	    }
 	  else
 	    begin_comment = false;
 	}
@@ -2792,7 +2798,9 @@
 		  input_line_number++;
 		  current_input_column = 0;
 		}
+
 	      in_comment = false;
+	      discard_space = true;
 
 	      if (in_parts)
 		{