From: Zbigniew Jędrzejewski-Szmek Date: Mon, 7 Jul 2014 20:10:38 +0000 (-0400) Subject: fstab-generator: add comma when removed option is in the middle X-Git-Tag: v216~719 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=36a259d22c450fbf3f696df0161db50275a98667;hp=c9fa3670bf24edf51c59c6e3904c2d0a1dd4b59d;ds=sidebyside fstab-generator: add comma when removed option is in the middle xxx,x-systemd.default-timeout=y,zzz was filtered to xxxzzz, but should be xxx,zzz, of course. --- diff --git a/src/shared/generator.c b/src/shared/generator.c index 5d5b6a0a6..2f9e5954c 100644 --- a/src/shared/generator.c +++ b/src/shared/generator.c @@ -125,7 +125,7 @@ int generator_write_timeouts(const char *dir, const char *what, const char *wher char *prefix, *postfix; prefix = strndupa(opts, start - opts - (start != opts)); - postfix = timeout + len + (timeout[len] != '\0'); + postfix = timeout + len + (start == opts && timeout[len] != '\0'); *filtered = strjoin(prefix, *postfix ? postfix : NULL, NULL); if (!*filtered) return log_oom();