]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5449: apply correct quoting, got older version of patch accidentally
authorNathan Neulinger <nneul@neulinger.org>
Fri, 31 May 2013 21:31:27 +0000 (16:31 -0500)
committerNathan Neulinger <nneul@neulinger.org>
Fri, 31 May 2013 21:40:17 +0000 (16:40 -0500)
src/switch_utils.c

index b3c6c40c197ab099b3b18fa54c4ad68ddc6d4bbb..3dbb61da940368e1c89189922c82e8b3ee17cca7 100644 (file)
@@ -2371,8 +2371,8 @@ SWITCH_DECLARE(char *) switch_util_quote_shell_arg_pool(const char *string, swit
                switch (string[i]) {
 #ifndef WIN32
                case '\'':
-                       /* We replace ' by sq dq sq dq sq, so need 4 additional bytes */
-                       dest_len += 4;
+                       /* We replace ' by sq backslace sq sq, so need 3 additional bytes */
+                       dest_len += 3;
                        break;
 #endif
                }
@@ -2380,7 +2380,7 @@ SWITCH_DECLARE(char *) switch_util_quote_shell_arg_pool(const char *string, swit
        dest_len += 1; /* closing quote */
 
        /* if we're given a pool, allocate from it, otherwise use malloc */
-       if ( pool ) {
+       if (pool) {
                dest = switch_core_alloc(pool, sizeof(char) * dest_len);
        } else {
                dest = (char *) malloc(sizeof(char) * dest_len);
@@ -2402,11 +2402,10 @@ SWITCH_DECLARE(char *) switch_util_quote_shell_arg_pool(const char *string, swit
                        break;
 #else
                case '\'':
-                       /* We replace ' by sq dq sq dq sq */
+                       /* We replace ' by sq backslash sq sq */
                        dest[n++] = '\'';
-                       dest[n++] = '"';
+                       dest[n++] = '\\';
                        dest[n++] = '\'';
-                       dest[n++] = '"';
                        dest[n++] = '\'';
                        break;
 #endif