Changeset 75f460 in git for Singular/run.c
- Timestamp:
- Dec 16, 2014, 3:43:21 PM (9 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
- Children:
- fce947c9e6c3e8c6d5a622c7f6b0d724580993cc
- Parents:
- a2e4470c6e9a666de8ab7b706370c15e13092f76
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/run.c
ra2e447 r75f460 20 20 * This program is based on the runemacs.c distributed with XEmacs 21.0 21 21 * 22 * Simple program to start gnu-win32 X11 programs (and native XEmacs) 22 * Simple program to start gnu-win32 X11 programs (and native XEmacs) 23 23 * with its console window hidden. 24 24 * 25 25 * This program is provided purely for convenience, since most users will 26 26 * use XEmacs in windowing (GUI) mode, and will not want to have an extra 27 * console window lying around. Ditto for desktop shortcuts to gnu-win32 27 * console window lying around. Ditto for desktop shortcuts to gnu-win32 28 28 * X11 executables. 29 29 */ … … 170 170 ((p2 = strrchr(p, '/')) && stricmp(p2, "/bin") == 0) ) 171 171 { 172 *p2 = '\0'; 172 *p2 = '\0'; 173 173 #if defined(__CYGWIN__) 174 174 CYGWIN_CONV_TO_POSIX_PATH((exec2,tmp)); … … 202 202 if (char_cnt > MAX_ARGS*MAX_PATH) /* then we ran out of room */ 203 203 error("command line too long -\n%s",new_cmdline); 204 204 205 205 strcpy(new_cmdline,exec); 206 206 for (i = first_arg; i < argc; i++) … … 229 229 * 5) convert to cygwin-style path to resolve symlinks within the pathspec 230 230 * 6) check filename: if it's a symlink, resolve it by peeking inside 231 * 7) convert to win32-style path+filename since we're using Windows 231 * 7) convert to win32-style path+filename since we're using Windows 232 232 * createProcess() to launch 233 233 */ … … 242 242 243 243 int len = 0; 244 /* 245 * STARTS WITH / or \ 244 /* 245 * STARTS WITH / or \ 246 246 * execpath NOT used 247 247 */ … … 250 250 #if defined(__CYGWIN__) 251 251 strcpy(exec_tmp,execname); 252 #else 252 #else 253 253 exec_tmp[0] = ((char) (_getdrive() + ((int) 'A') - 1)); 254 254 exec_tmp[1] = ':'; … … 268 268 Trace((exec_tmp2)); 269 269 } 270 /* 270 /* 271 271 * STARTS WITH x:\ or x:/ 272 272 * execpath NOT used … … 276 276 ((execname[2] == '\\') || (execname[2] == '/'))) 277 277 { 278 strcpy(exec_tmp,execname); 278 strcpy(exec_tmp,execname); 279 279 Trace(("x: -\nexec_tmp\t%s\nexecname\t%s\nexecpath\t%s\n", 280 280 exec_tmp,execname,execpath)); … … 289 289 Trace((exec_tmp2)); 290 290 } 291 /* 291 /* 292 292 * STARTS WITH ./ or .\ 293 293 */ … … 321 321 orig_pathlist = getenv("PATH"); 322 322 if ((pathlist = malloc (strlen(orig_pathlist) 323 + strlen(".") 323 + strlen(".") 324 324 + strlen(execpath)+ 3)) == NULL) 325 325 error("internal error - out of memory"); … … 369 369 CYGWIN_CONV_TO_POSIX_PATH((exec_tmp,sym_link_name)); 370 370 Trace((sym_link_name)); 371 371 372 372 if (lstat(sym_link_name, &stbuf) == 0) 373 373 { … … 378 378 else 379 379 { 380 // if realname starts with '/' it's a rootpath 380 // if realname starts with '/' it's a rootpath 381 381 if (real_name[0] == '/') 382 382 strcpy(exec_tmp2,real_name); … … 397 397 } 398 398 CYGWIN_CONV_TO_FULL_WIN32_PATH((exec_tmp2,exec)); 399 #else 399 #else 400 400 strcpy (exec, exec_tmp2); 401 #endif 401 #endif 402 402 } 403 403 int endsWith(const char* s1, const char* s2) … … 510 510 * additionally, backslash escapes next character, even if that 511 511 * next character is a delimiter. Or a double quote. 512 * WARNING: this means that backslash may NOT be a delimiter 512 * WARNING: this means that backslash may NOT be a delimiter 513 513 */ 514 514 char* my_strtok(char* s, const char* delim, char** lasts) … … 517 517 int c, sc; 518 518 char *tok; 519 519 520 520 if ((s == NULL) && ((s = *lasts) == NULL)) 521 521 return NULL; … … 562 562 c = *s++; /* otherwise, skip the escaped character */ 563 563 } 564 #endif 564 #endif 565 565 spanp = (char *)delim; 566 566 do { … … 628 628 char *recursive_name; 629 629 int foundit = FALSE; 630 630 631 631 returnval[0] = '\0'; 632 632 … … 652 652 return retval; 653 653 } 654 int fileExistsMulti(char* fullname, const char* path, 654 int fileExistsMulti(char* fullname, const char* path, 655 655 const char* name_noext, const char* exts[], 656 656 const int extcnt) … … 689 689 else 690 690 work[0]='\0'; 691 691 692 692 strcat(work, name); 693 693 #if defined(__CYGWIN__) 694 CYGWIN_CONV_TO_POSIX_PATH((work, work2)); 694 CYGWIN_CONV_TO_POSIX_PATH((work, work2)); 695 695 #else 696 696 strcpy(work2,work);
Note: See TracChangeset
for help on using the changeset viewer.