summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2009-04-08 15:08:10 +0100
committerRichard Jones <rjones@redhat.com>2009-04-08 15:08:10 +0100
commit447b96e57cdf40ddc3b7669ba65dbea961748f71 (patch)
tree0c70bcfcbd603de3eaad9c780a747f6469fafdd8 /daemon
parent9908e03e922b670437bcd89b6873f9ebc914567e (diff)
downloadlibguestfs-447b96e57cdf40ddc3b7669ba65dbea961748f71.tar.gz
libguestfs-447b96e57cdf40ddc3b7669ba65dbea961748f71.tar.xz
libguestfs-447b96e57cdf40ddc3b7669ba65dbea961748f71.zip
Bug fix: Trailing whitespace from 'pvs' command.
Diffstat (limited to 'daemon')
-rw-r--r--daemon/lvm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/daemon/lvm.c b/daemon/lvm.c
index bc385474..7f31c84e 100644
--- 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;