chiark / gitweb /
fileio: quote more shell characters in envfiles
[elogind.git] / src / shared / util.h
index c5eadc97c093c091264201c7ef330efb1549849e..b3187a9ea1d708e789b22862d8544c381526bb22 100644 (file)
 #define COMMENTS   "#;"
 #define GLOB_CHARS "*?["
 
+/* What characters are special in the shell? */
+/* must be escaped outside and inside double-quotes */
+#define SHELL_NEED_ESCAPE "\"\\`$"
+/* can be escaped or double-quoted */
+#define SHELL_NEED_QUOTES SHELL_NEED_ESCAPE GLOB_CHARS "'()<>|&;"
+
 #define FORMAT_BYTES_MAX 8
 
 #define ANSI_HIGHLIGHT_ON "\x1B[1;39m"