From: Roman Yepishev Subject: Fixes single-line strn() and comment handling and --- a/src/osdsh/controlsh.c +++ b/src/osdsh/controlsh.c @@ -103,20 +103,23 @@ i++; } arg_first[a] = '\0'; - i++; a = 0; - while((c=arguments[i])!='\n'&&c!='\0'&&c!=')') { - if (c=='\\') { - i++; - arg_secound[a] = arguments[i]; + if (arguments[i]==',') { + i++; + while((c=arguments[i])!='\n'&&c!='\0'&&c!=')') { + if (c=='\\') { + i++; + arg_secound[a] = arguments[i]; + } + else { + arg_secound[a] = c; + } + a++; + i++; } - else { - arg_secound[a] = c; - } - a++; - i++; } + arg_secound[a] = '\0'; /* done with the arguments */ @@ -220,7 +223,7 @@ /*Read the bufer and check that it's not a comment*/ while(fgets(readbuf, BUFSIZ, fp)) { - if (readbuf[c]=='#') continue; + if (readbuf[0]=='#') continue; /*ignore spaces*/ for (i=0; i