Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.249
 
1.250
 
MAIN:plunky:20120907091558
 
cc.c
_>242242 int main(int, char *[]);
 243243 void error(char *, ...);
 244244 void errorx(int, char *, ...);
<>245 -int callsys(char [], char *[]);
246245 int cunlink(char *);
 247246 void exandrm(char *);
 248247 void dexit(int);
     
 !
260259 static void expand_sysroot(void);
 261260 #ifdef os_win32
 262261 char *win32pathsubst(char *);
<>263 -char *win32commandline(char *, char *[]);
  262+char *win32commandline(struct strlist *l);
264263 #endif
 265264 int     sspflag;
 266265 int     freestanding;
     
 !
12331232 }
 12341233 
 12351234 #ifdef os_win32
<>1236 -#define MAX_CMDLINE_LENGTH 32768
 1237 -int
 1238 -callsys(char *f, char *v[])
  1235+
  1236+static int
  1237+strlist_exec(struct strlist *l)
12391238 {
 12401239         char *cmd;
 12411240         STARTUPINFO si;
 12421241         PROCESS_INFORMATION pi;
 12431242         DWORD exitCode;
 12441243         BOOL ok;
 12451244 
<>1246 -        cmd = win32commandline(f, v);
  1245+        cmd = win32commandline(l);
12471246         if (vflag)
 12481247                 printf("%s\n", cmd);
 12491248 
     
 !
12631262                 &pi);
 12641263 
 12651264         if (!ok) {
<>1266 -                fprintf(stderr, "Can't find %s\n", f);
  1265+                fprintf(stderr, "Can't find %s\n", STRLIST_FIRST(l)->value);
12671266                 return 100;
 12681267         }
 12691268 
     
 !
12751274         return (exitCode != 0);
 12761275 }
 12771276 
<>1278 -#endif
  1277+#else
12791278 
 12801279 static int
 12811280 strlist_exec(struct strlist *l)
     
 !
13171316         return exit_now;
 13181317 }
 13191318 
<> 1319+#endif
  1320+
13201321 /*
 13211322  * Catenate two (optional) strings together
 13221323  */
     
 !
18291830 }
 18301831 
 18311832 char *
<>1832 -win32commandline(char *f, char *args[])
  1833+win32commandline(struct strlist *l)
18331834 {
<> 1835+        const struct string *s;
18341836         char *cmd;
 18351837         char *p;
 18361838         int len;
<>1837 -        int i, j, k;
  1839+        int j, k;
18381840 
<>1839 -        len = strlen(f) + 3;
 1840 -
 1841 -        for (i = 1; args[i] != NULL; i++) {
 1842 -                for (j = 0; args[i][j] != '\0'; j++) {
  1841+        len = 0;
  1842+        STRLIST_FOREACH(s, l) {
  1843+                for (j = 0; s->value[j] != '\0'; j++) {
18431844                         len++;
<>1844 -                        if (args[i][j] == '\"') {
 1845 -                                for (k = j-1; k >= 0 && args[i][k] == '\\'; k--)
  1845+                        if (s->value[j] == '\"') {
  1846+                                for (k = j-1; k >= 0 && s->value[k] == '\\'; k--)
18461847                                         len++;
 18471848                         }
 18481849                 }
<>1849 -                for (k = j-1; k >= 0 && args[i][k] == '\\'; k--)
  1850+                for (k = j-1; k >= 0 && s->value[k] == '\\'; k--)
18501851                         len++;
 18511852                 len += j + 3;
 18521853         }
 18531854 
 18541855         p = cmd = xmalloc(len);
<>1855 -        *p++ = '\"';
 1856 -        p += strlcpy(p, f, len-1);
 1857 -        *p++ = '\"';
 1858 -        *p++ = ' ';
18591856 
<>1860 -        for (i = 1; args[i] != NULL; i++) {
  1857+        STRLIST_FOREACH(s, l) {
18611858                 *p++ = '\"';
<>1862 -                for (j = 0; args[i][j] != '\0'; j++) {
 1863 -                        if (args[i][j] == '\"') {
 1864 -                                for (k = j-1; k >= 0 && args[i][k] == '\\'; k--)
  1859+                for (j = 0; s->value[j] != '\0'; j++) {
  1860+                        if (s->value[j] == '\"') {
  1861+                                for (k = j-1; k >= 0 && s->value[k] == '\\'; k--)
18651862                                         *p++ = '\\';
 18661863                                 *p++ = '\\';
 18671864                         }
<>1868 -                        *p++ = args[i][j];
  1865+                        *p++ = s->value[j];
18691866                 }
<>1870 -                for (k = j-1; k >= 0 && args[i][k] == '\\'; k--)
  1867+                for (k = j-1; k >= 0 && s->value[k] == '\\'; k--)
<_18711868                         *p++ = '\\';
 18721869                 *p++ = '\"';
 18731870                 *p++ = ' ';
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-09-22 10:14 +0200