From 35838def32a9ab13a12aa886b847b5a0d6056899 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 21 Nov 2017 17:58:51 +0100 Subject: [PATCH] CODING_STYLE: document the order in which unescaping + specifier expansion should be done --- CODING_STYLE | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CODING_STYLE b/CODING_STYLE index 9dcc090..b090db3 100644 --- a/CODING_STYLE +++ b/CODING_STYLE @@ -434,3 +434,8 @@ that interrupted system calls are automatically restarted, and we minimize hassles with handling EINTR (in particular as EINTR handling is pretty broken on Linux). + +- When applying C-style unescaping as well as specifier expansion on the same + string, always apply the C-style unescaping fist, followed by the specifier + expansion. When doing the reverse, make sure to escape '%' in specifier-style + first (i.e. '%' → '%%'), and then do C-style escaping where necessary. -- 2.7.4