# HG changeset patch # User Rik # Date 1385432923 28800 # Node ID b992a17767fee9c7996e815c2e331d19361320ef # Parent 79653c5b614716e9cda49be6b639de9f3ffe2d93 main.in.cc: Replace tabs with spaces. Shorten lines > 80 chars. main.in.cc: Replace tabs with spaces. Shorten lines > 80 chars. diff -r 79653c5b6147 -r b992a17767fe src/main.in.cc --- a/src/main.in.cc Mon Nov 25 16:24:47 2013 -0500 +++ b/src/main.in.cc Mon Nov 25 18:28:43 2013 -0800 @@ -435,7 +435,8 @@ return obd.empty () ? subst_octave_home (std::string (OCTAVE_BINDIR)) : obd; } -#if defined (__WIN32__) && ! defined (__CYGWIN__) // Adapted from libtool wrapper. +// Adapted from libtool wrapper. +#if defined (__WIN32__) && ! defined (__CYGWIN__) /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter @@ -482,68 +483,68 @@ const char *string = argv[i]; if (string[0] == '\0') - new_argv[i] = strdup ("\"\""); + new_argv[i] = strdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) - { - int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); - size_t length; - unsigned int backslashes; - const char *s; - char *quoted_string; - char *p; + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; - length = 0; - backslashes = 0; - if (quote_around) - length++; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - length += backslashes + 1; - length++; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - length += backslashes + 1; + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; - quoted_string = new char [length + 1]; + quoted_string = new char [length + 1]; - p = quoted_string; - backslashes = 0; - if (quote_around) - *p++ = '"'; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - { - unsigned int j; - for (j = backslashes + 1; j > 0; j--) - *p++ = '\\'; - } - *p++ = c; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - { - unsigned int j; - for (j = backslashes; j > 0; j--) - *p++ = '\\'; - *p++ = '"'; - } - *p = '\0'; + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; - new_argv[i] = quoted_string; - } + new_argv[i] = quoted_string; + } else - new_argv[i] = (char *) string; + new_argv[i] = (char *) string; } new_argv[argc] = NULL;