summaryrefslogtreecommitdiff
path: root/libsm/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'libsm/string.c')
-rw-r--r--libsm/string.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/libsm/string.c b/libsm/string.c
index 2b06e2c7ec78..83577f19a84e 100644
--- a/libsm/string.c
+++ b/libsm/string.c
@@ -54,3 +54,34 @@ stripquotes(s)
*q++ = c;
} while (c != '\0');
}
+
+/*
+** UNFOLDSTRIPQUOTES -- Strip quotes & quote bits from a string.
+**
+** Parameters:
+** s -- the string to strip.
+**
+** Returns:
+** none.
+*/
+
+void
+unfoldstripquotes(s)
+ char *s;
+{
+ char *p, *q, c;
+
+ if (s == NULL)
+ return;
+
+ p = q = s;
+ do
+ {
+ c = *p++;
+ if (c == '\\' || c == '\n')
+ c = *p++;
+ else if (c == '"')
+ continue;
+ *q++ = c;
+ } while (c != '\0');
+}