Commit 28bb89cf 28bb89cfb2a3394540de6c3b2e3cf5e183e5d997 by Sergey Poznyakoff

(argcv_scan): Correclty handle comments without intervening whitespace

between the comment character and remaining text, e.g.:
	set a=2 #comment
1 parent 120cbac4
2002-02-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2002-02-23 Sergey Poznyakoff
* lib/argcv.c: Yesterday's fix makes argcv_get include trailing
whitespace to the arg array. To fix:
whitespace to the argv array. To fix:
(argcv_scan): Return len+1 if called on or after
the terminating null character.
(argcv_get): Initialize *argc to zero and continue scanning
until argcv_scan return is > len. Thanks Sam for noticing.
More fixes:
(argcv_scan): Correclty handle comments without intervening
whitespace between the comment character and remaining text,
e.g.:
set a=2 #comment
2002-02-22 Sergey Poznyakoff
* lib/argcv.c (argcv_get): Bugfix, *argc must be initialized to 1.
......
......@@ -72,7 +72,7 @@ argcv_scan (int len, const char *command, const char *delim, const char* cmnt,
/* If we have a token, and it starts with a comment character, skip
to the newline and restart the token search. */
if (*save < len)
if (*save <= len)
{
if (cmnt && strchr (cmnt, command[*start]) != NULL)
{
......