summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/util.c b/util.c
index 43826990cd..939b2b06e9 100644
--- a/util.c
+++ b/util.c
@@ -611,6 +611,23 @@ char *strstrip(char *s) {
}
+char *delete_chars(char *s, const char *bad) {
+ char *f, *t;
+
+ /* Drops all whitespace, regardless where in the string */
+
+ for (f = s, t = s; *f; f++) {
+ if (strchr(bad, *f))
+ continue;
+
+ *(t++) = *f;
+ }
+
+ *t = 0;
+
+ return s;
+}
+
char *file_in_same_dir(const char *path, const char *filename) {
char *e, *r;
size_t k;