X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Flvm.c;h=7f31c84ed53965d49282f4818393ea07c2a56277;hb=13339826ea01f8dbd581b5d2544e7692171cf386;hp=bc38547449208654e9f2611f67275f609f7f7c9c;hpb=6085137e65cb63aaf725207f2929a571d1149420;p=libguestfs.git diff --git a/daemon/lvm.c b/daemon/lvm.c index bc38547..7f31c84 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;