Displaying 5 results from an estimated 5 matches for "bs_unescape_filename".
Did you mean:
bs_escape_filename
2014 Oct 31
6
[PATCH 0/3] WIP readline escaping functions
From: Maros Zatko <hacxman@gmail.com>
Auxiliary functions for readline to support space character escaping
in filenames in future.
Escaping function is taken from fish.c (used to be parse_quoted_string)
plus its un-escaping counterpart. There are a few tests for both.
Maros Zatko (3):
fish: rl.{c,h} - escaping functions for readline
fish: basic tests for readline escaping
autotools:
2014 Oct 31
0
[PATCH 2/3] fish: basic tests for readline escaping
...+eq_bracket (char *(*fn)(char*), char * in, char * out)
+{
+ char * q = fn(in);
+ return (q != NULL) && STREQ(q, out);
+}
+
+int
+test_empty_escape (void)
+{
+ return eq_bracket(bs_escape_filename, "", "");
+}
+
+int
+test_empty_unescape (void)
+{
+ return eq_bracket(bs_unescape_filename, "", "");
+}
+
+int
+test_singlespace_escape (void)
+{
+ return eq_bracket(bs_escape_filename, " ", "\\ ");
+}
+
+int
+test_singlespace_unescape (void)
+{
+ return eq_bracket(bs_unescape_filename, "\\ ", " ");
+}
+
+int
+test_singleword_...
2014 Nov 07
3
[PATCH 0/3] v2 readline escaping functions
From: Maros Zatko <mzatko@redhat.com>
Helper functions for future support of backslash escaped spaces in filenames.
There are a few tests too. Changed according to review remarks.
Maros Zatko (3):
fish: rl.{c, h} - escaping functions for readline
fish: basic tests for readline escaping
autotools: add fish/test
Makefile.am | 1 +
configure.ac | 1 +
2014 Nov 13
4
[PATCH 0/4 v3] readline escaping functions
Helper functions for future support of backslash escaped spaces in filenames.
There are a few tests too. Changed according to review remarks and fixed few
other mistakes.
Maros Zatko (4):
fish: copy parse_quoted_string and hexdigit from fish.h to rl.c
fish: rl.{c,h} - escaping functions for readline
fish: basic tests for readline escaping
autotools: add fish/test
Makefile.am
2014 Oct 31
0
[PATCH 1/3] fish: rl.{c, h} - escaping functions for readline
...xdigit (char d)
+{
+ switch (d) {
+ case '0'...'9': return d - '0';
+ case 'a'...'f': return d - 'a' + 10;
+ case 'A'...'F': return d - 'A' + 10;
+ default: return -1;
+ }
+}
+
+// backslash unescape for readline
+char *
+bs_unescape_filename (char *str)
+{
+ char *p = calloc(strlen(str) + 1, 1);
+ strcpy(p, str);
+ char *start = p;
+
+ for (; *p; p++) {
+ if (*p == '\\') {
+ int m = 1, c;
+
+ switch (p[1]) {
+ case '\\': break;
+ case 'a': *p = '\a'; break;
+ case 'b...