From 11ce3427242b8b4ddf638ed5703d69041d719b4c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 20 Aug 2010 02:46:15 +0200 Subject: mount: properly handle LABEL="" in fstab --- src/util.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/util.c') 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", -- cgit v1.2.3-54-g00ecf