summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-11-19 14:54:17 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2009-11-19 14:54:17 +0100
commitbd732f8f882ab1c5699ccbd8f1618995a46e5890 (patch)
tree9197c44c424f063078d82173ac7e3017e856413e
parent12e78322c5fdd633c6582b8049ed8b412b275fd6 (diff)
print_escaped: Add a comment about escapism^wshell quoting
-rw-r--r--src/envstore.c8
1 files changed, 8 insertions, 0 deletions
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;