diff options
author | Simon J. Gerraty <sjg@FreeBSD.org> | 2014-04-28 07:50:45 +0000 |
---|---|---|
committer | Simon J. Gerraty <sjg@FreeBSD.org> | 2014-04-28 07:50:45 +0000 |
commit | 3b8f08459569bf0faa21473e5cec2491e95c9349 (patch) | |
tree | 80f45dd81ca716bcd7ca9674581e1fc40b93cd34 /usr.bin/ministat | |
parent | 9d2ab4a62d6733c45958627ac113bdbd818d1e2a (diff) | |
parent | b2ba55951383498f252746f618d513139da06e8e (diff) | |
download | src-3b8f08459569bf0faa21473e5cec2491e95c9349.tar.gz src-3b8f08459569bf0faa21473e5cec2491e95c9349.zip |
Merge head
Notes
Notes:
svn path=/projects/bmake/; revision=265044
Diffstat (limited to 'usr.bin/ministat')
-rw-r--r-- | usr.bin/ministat/ministat.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ministat/ministat.c b/usr.bin/ministat/ministat.c index 218715c82421..c8d8e12355c9 100644 --- a/usr.bin/ministat/ministat.c +++ b/usr.bin/ministat/ministat.c @@ -13,6 +13,7 @@ __FBSDID("$FreeBSD$"); #include <stdio.h> #include <math.h> +#include <ctype.h> #include <err.h> #include <string.h> #include <stdlib.h> @@ -475,8 +476,8 @@ ReadSet(const char *n, int column, const char *delim) line++; i = strlen(buf); - if (buf[i-1] == '\n') - buf[i-1] = '\0'; + while (i > 0 && isspace(buf[i - 1])) + buf[--i] = '\0'; for (i = 1, t = strtok(buf, delim); t != NULL && *t != '#'; i++, t = strtok(NULL, delim)) { |