diff options
author | Karel Zak | 2010-12-07 00:08:11 +0100 |
---|---|---|
committer | Karel Zak | 2011-01-03 12:28:47 +0100 |
commit | 5ac6a133276d200e1736853e58a05887e7f75e90 (patch) | |
tree | 29dfa064cd89c1c155c10186739f77a76ce932ef /shlibs/mount/src/tab_parse.c | |
parent | libmount: minor fixes in cache.c (diff) | |
download | kernel-qcow2-util-linux-5ac6a133276d200e1736853e58a05887e7f75e90.tar.gz kernel-qcow2-util-linux-5ac6a133276d200e1736853e58a05887e7f75e90.tar.xz kernel-qcow2-util-linux-5ac6a133276d200e1736853e58a05887e7f75e90.zip |
libmount: cleanup mangle() usage
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/tab_parse.c')
-rw-r--r-- | shlibs/mount/src/tab_parse.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/shlibs/mount/src/tab_parse.c b/shlibs/mount/src/tab_parse.c index 16fab89d8..d7c27e65f 100644 --- a/shlibs/mount/src/tab_parse.c +++ b/shlibs/mount/src/tab_parse.c @@ -182,40 +182,44 @@ static int mnt_parse_utab_line(mnt_fs *fs, const char *s) assert(!fs->target); while (p && *p) { + char *end = NULL; + while (*p == ' ') p++; if (!*p) break; if (!fs->source && !strncmp(p, "SRC=", 4)) { - char *v = unmangle(p + 4, &p); + char *v = unmangle(p + 4, &end); if (!v) goto enomem; if (strcmp(v, "none")) __mnt_fs_set_source_ptr(fs, v); } else if (!fs->target && !strncmp(p, "TARGET=", 7)) { - fs->target = unmangle(p + 7, &p); + fs->target = unmangle(p + 7, &end); if (!fs->target) goto enomem; } else if (!fs->root && !strncmp(p, "ROOT=", 5)) { - fs->root = unmangle(p + 5, &p); + fs->root = unmangle(p + 5, &end); if (!fs->root) goto enomem; } else if (!fs->bindsrc && !strncmp(p, "BINDSRC=", 8)) { - fs->bindsrc = unmangle(p + 8, &p); + fs->bindsrc = unmangle(p + 8, &end); if (!fs->bindsrc) goto enomem; } else if (!fs->optstr && !strncmp(p, "OPTS=", 5)) { - fs->optstr = unmangle(p + 5, &p); + fs->optstr = unmangle(p + 5, &end); if (!fs->optstr) goto enomem; } else { /* unknown variable */ while (*p && *p != ' ') p++; } + if (end) + p = end; } return 0; |