From bd732f8f882ab1c5699ccbd8f1618995a46e5890 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 19 Nov 2009 14:54:17 +0100 Subject: print_escaped: Add a comment about escapism^wshell quoting --- src/envstore.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/envstore.c b/src/envstore.c index 7cb1f68..5ca1eec 100644 --- a/src/envstore.c +++ b/src/envstore.c @@ -72,6 +72,14 @@ static FILE * store_open_new(char *file) { } +/* + * A little note on shell quoting: + * ' at beginning and end do most of the job for us, except when we have a ' + * inside the quoted value. It can't be escaped directly, so we end the quote + * (with a ') and then add an escaped '. Possible ways are \' and "'" (in this + * case, the latter is used). Afterwards another normal ' is added and the + * quoted string continues. + */ static inline void print_escaped(char *name, char *content) { unsigned int i; -- cgit v1.2.3