projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
e11c410
)
Have strip_blank_end() also strip off any comments
author
Jens Axboe
<jens.axboe@oracle.com>
Wed, 4 Apr 2007 09:04:06 +0000
(11:04 +0200)
committer
Jens Axboe
<jens.axboe@oracle.com>
Wed, 4 Apr 2007 09:04:06 +0000
(11:04 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
parse.c
patch
|
blob
|
blame
|
history
diff --git
a/parse.c
b/parse.c
index ace34a697d20af4ffcff9fd013898927f3dd550c..9015b1d72bd5a527ef36ed0db12646ce01fcc945 100644
(file)
--- a/
parse.c
+++ b/
parse.c
@@
-148,8
+148,18
@@
void strip_blank_front(char **p)
void strip_blank_end(char *p)
{
- char *s = p + strlen(p) - 1;
-
+ char *s;
+
+ s = strchr(p, ';');
+ if (s)
+ *s = '\0';
+ s = strchr(p, '#');
+ if (s)
+ *s = '\0';
+ if (s)
+ p = s;
+
+ s = p + strlen(p) - 1;
while (isspace(*s) || iscntrl(*s))
s--;