Mercurial > hg > octave-lyh
diff scripts/gethelp.cc @ 3427:e098ebb77023
[project @ 2000-01-13 09:25:53 by jwe]
author | jwe |
---|---|
date | Thu, 13 Jan 2000 09:25:59 +0000 |
parents | 35a6d027772c |
children | 7576a76f6d7b |
line wrap: on
line diff
--- a/scripts/gethelp.cc +++ b/scripts/gethelp.cc @@ -10,9 +10,9 @@ { bool retval = false; - string t = s.substr (0, 15); + string t = s.substr (0, 14); - if (t == " Copyright (C) ") + if (t == "Copyright (C) ") { size_t pos = s.find ('\n'); @@ -24,10 +24,10 @@ { pos++; - t = s.substr (pos, 29); + t = s.substr (pos, 28); - if (t == " This file is part of Octave." - || t == " This program is free softwar") + if (t == "This file is part of Octave." + || t == "This program is free softwar") retval = true; } } @@ -48,6 +48,7 @@ bool begin_comment = false; bool have_help_text = false; bool in_comment = false; + bool discard_space = true; int c; while ((c = cin.get ()) != EOF) @@ -56,6 +57,11 @@ { if (c == '%' || c == '#') continue; + else if (discard_space && c == ' ') + { + discard_space = false; + continue; + } else begin_comment = false; } @@ -71,6 +77,7 @@ if (c == '\n') { in_comment = false; + discard_space = true; if ((c = cin.get ()) != EOF) {