diff options
author | Rory Bradford <roryrjb@gmail.com> | 2022-04-22 08:34:50 +0100 |
---|---|---|
committer | Rory Bradford <roryrjb@gmail.com> | 2022-04-22 08:34:50 +0100 |
commit | 0ccfd0e3d4563e90b30a6d6fecf5d2d6665c0980 (patch) | |
tree | 132764e55bfad25b5859be64718226bf9c675c6a | |
parent | f5bad0e0f8e7fbcd923e0cf46802e6de7e168f52 (diff) | |
download | rf-0ccfd0e3d4563e90b30a6d6fecf5d2d6665c0980.tar.gz |
Remove path escaping
Signed-off-by: Rory Bradford <roryrjb@gmail.com>
-rw-r--r-- | rf.c | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/rf.c b/rf.c index ec315b9..cd5e75e 100644 --- a/rf.c +++ b/rf.c @@ -96,44 +96,6 @@ static int excluded(const char *name) { return 0; } -char *escape_string(char *input) { - char ch; - int i = 0; - int j = 0; - char *output = calloc(sizeof(char), strlen(input) * 2); - - while ((ch = input[i]) != '\0') { - switch (ch) { - case ' ': - case '\t': - case '\'': - case '(': - case ')': - output[j++] = '\\'; - output[j++] = ch; - i++; - break; - default: - output[j++] = input[i++]; - } - } - - return output; -} - -int has_spaces(char *input) { - char ch; - int i = 0; - - while ((ch = input[i++]) != '\0') { - if (isspace(ch)) { - return 1; - } - } - - return 0; -} - /* return 1 if breaking early (e.g. reaching limit) otherwise return 0 */ static int recurse_find(char **patterns, int *pattern_count, const char *dirname, struct switches *switches) { @@ -209,9 +171,7 @@ static int recurse_find(char **patterns, int *pattern_count, if (matched) { if (is_child(entry->d_name) != 0) { - char *escaped = escape_string(full_path); - printf("%s\n", escaped); - free(escaped); + printf("%s\n", full_path); } if (switches->limit > 0 && |