[systemd-devel] [PATCH] util: don't consider trailing whitespaces as an empty string in split_quoted

Lukas Nykryn lnykryn at redhat.com
Wed Nov 27 09:00:04 PST 2013


---
 src/shared/util.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/shared/util.c b/src/shared/util.c
index 3a4d196..c68ab09 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -383,7 +383,9 @@ char *split_quoted(const char *c, size_t *l, char **state) {
 
         current += strspn(current, WHITESPACE);
 
-        if (*current == '\'') {
+        if (*current == 0)
+                return NULL;
+        else if (*current == '\'') {
                 current ++;
 
                 for (e = current; *e; e++) {
-- 
1.8.3.1



More information about the systemd-devel mailing list