aboutsummaryrefslogtreecommitdiff
path: root/src/lib9/needsrcquote.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib9/needsrcquote.c')
-rw-r--r--src/lib9/needsrcquote.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib9/needsrcquote.c b/src/lib9/needsrcquote.c
new file mode 100644
index 00000000..f4cf460c
--- /dev/null
+++ b/src/lib9/needsrcquote.c
@@ -0,0 +1,12 @@
+#include <u.h>
+#include <libc.h>
+
+int
+needsrcquote(int c)
+{
+ if(c <= ' ')
+ return 1;
+ if(strchr("`^#*[]=|\\?${}()'<>&;", c))
+ return 1;
+ return 0;
+}