diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-08-20 02:46:15 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-08-20 02:46:15 +0200 |
commit | 11ce3427242b8b4ddf638ed5703d69041d719b4c (patch) | |
tree | 42470b61324288d4bc08f21c5126a32521ce3b76 /src/util.c | |
parent | 049f86421bfe8afcbb00c7ee5a76fd14841f8bbf (diff) |
mount: properly handle LABEL="" in fstab
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c index 7903ca07b9..f1a7bbdc71 100644 --- a/src/util.c +++ b/src/util.c @@ -3004,6 +3004,19 @@ int touch(const char *path) { return 0; } +char *unquote(const char *s, const char quote) { + size_t l; + assert(s); + + if ((l = strlen(s)) < 2) + return strdup(s); + + if (s[0] == quote && s[l-1] == quote) + return strndup(s+1, l-2); + + return strdup(s); +} + static const char *const ioprio_class_table[] = { [IOPRIO_CLASS_NONE] = "none", [IOPRIO_CLASS_RT] = "realtime", |