library: create cmdlines consistently with no trailing space

When PROC_FILLARG was used (invoking file2strvec)
command lines contained no trailing space.

When PROC_EDITCMDLCVT was used (invoking read_unvectored)
command lines contained a trailing space.

Now both routes to a cmdline act the same -- no trailing space.
This commit is contained in:
Jim Warner 2011-12-08 10:19:38 -06:00 committed by Craig Small
parent ed59472307
commit a5881b5a4e

View File

@ -611,7 +611,7 @@ static int read_unvectored(char *restrict const dst, unsigned sz, const char* wh
}
close(fd);
if(n){
int i=n;
int i=n-1;
while(i--)
if(dst[i]=='\n' || dst[i]=='\0') dst[i]=sep;
}