git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9908e03
)
Bug fix: Trailing whitespace from 'pvs' command.
author
Richard Jones
<rjones@redhat.com>
Wed, 8 Apr 2009 14:08:10 +0000
(15:08 +0100)
committer
Richard Jones
<rjones@redhat.com>
Wed, 8 Apr 2009 14:08:10 +0000
(15:08 +0100)
daemon/lvm.c
patch
|
blob
|
history
diff --git
a/daemon/lvm.c
b/daemon/lvm.c
index
bc38547
..
7f31c84
100644
(file)
--- a/
daemon/lvm.c
+++ b/
daemon/lvm.c
@@
-37,6
+37,7
@@
convert_lvm_output (char *out, char *prefix)
char *p, *pend;
char **r = NULL;
int size = 0, alloc = 0;
+ int len;
char buf[256];
char *str;
@@
-51,6
+52,11
@@
convert_lvm_output (char *out, char *prefix)
while (*p && isspace (*p)) /* Skip any leading whitespace. */
p++;
+ /* Sigh, skip trailing whitespace too. "pvs", I'm looking at you. */
+ len = strlen (p)-1;
+ while (*p && isspace (p[len]))
+ p[len--] = '\0';
+
if (!*p) { /* Empty line? Skip it. */
p = pend;
continue;