mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
Bug fix: Trailing whitespace from 'pvs' command.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user