43ff24c
From 06d46a47eb13907a597a0e67cd8142321a81494e Mon Sep 17 00:00:00 2001
43ff24c
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
43ff24c
Date: Mon, 7 Jul 2014 16:10:38 -0400
43ff24c
Subject: [PATCH] fstab-generator: add comma when removed option is in the
43ff24c
 middle
43ff24c
43ff24c
xxx,x-systemd.default-timeout=y,zzz was filtered to xxxzzz,
43ff24c
but should be xxx,zzz, of course.
43ff24c
43ff24c
(cherry picked from commit 36a259d22c450fbf3f696df0161db50275a98667)
43ff24c
---
43ff24c
 src/shared/generator.c | 2 +-
43ff24c
 1 file changed, 1 insertion(+), 1 deletion(-)
43ff24c
43ff24c
diff --git a/src/shared/generator.c b/src/shared/generator.c
43ff24c
index 5d5b6a0a61..2f9e5954c2 100644
43ff24c
--- a/src/shared/generator.c
43ff24c
+++ b/src/shared/generator.c
43ff24c
@@ -125,7 +125,7 @@ int generator_write_timeouts(const char *dir, const char *what, const char *wher
43ff24c
                 char *prefix, *postfix;
43ff24c
 
43ff24c
                 prefix = strndupa(opts, start - opts - (start != opts));
43ff24c
-                postfix = timeout + len + (timeout[len] != '\0');
43ff24c
+                postfix = timeout + len + (start == opts && timeout[len] != '\0');
43ff24c
                 *filtered = strjoin(prefix, *postfix ? postfix : NULL, NULL);
43ff24c
                 if (!*filtered)
43ff24c
                         return log_oom();