systemd/core-interpret-escaped-semicolon-as-escaped.patch

31 lines
1.1 KiB
Diff
Raw Normal View History

From 7e1a84f55244ca78093b1dabc58683bc0e7f4304 Mon Sep 17 00:00:00 2001
From: Oleksii Shevchuk <alxchk@gmail.com>
Date: Sat, 3 Nov 2012 21:52:02 +0200
Subject: [PATCH] core: interpret \; token in ExecStart as escaped ;
Some commands (like 'find') take a semicolon as separate arg. With
current parser implementation there is no way to pass one.
Patch adds token \;
---
src/core/load-fragment.c | 2 ++
src/test/test-unit-file.c | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 5803044..4dc5c52 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -483,6 +483,8 @@ int config_parse_exec(
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
if (strncmp(w, ";", MAX(l, 1U)) == 0)
break;
+ else if (strncmp(w, "\\;", MAX(l, 1U)) == 0)
+ w ++;
if (honour_argv0 && w == rvalue) {
assert(!path);
--
1.7.10.4