Changeset ef0124 in git for Singular/feResource.cc
- Timestamp:
- May 5, 2000, 8:40:34 PM (24 years ago)
- Branches:
- (u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
- Children:
- ba9453910d26fdb676fa083bc02d866111ea5ece
- Parents:
- f9bfec9b7263804ac776257b32087185168b1000
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/feResource.cc
rf9bfec ref0124 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: feResource.cc,v 1.2 3 2000-04-27 10:07:06obachman Exp $ */4 /* $Id: feResource.cc,v 1.24 2000-05-05 18:40:28 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: management of resources … … 11 11 #include "mod2.h" 12 12 #include "distrib.h" 13 #if ndef ESINGULAR13 #if !defined(ESINGULAR) && !defined(TSINGULAR) 14 14 #include "mmemory.h" 15 15 #include "febase.h" … … 21 21 22 22 #if defined(MAKE_DISTRIBUTION) 23 #if defined(WINNT) 23 #if defined(WINNT) && ! defined(__CYGWIN__) 24 24 #define SINGULAR_DEFAULT_DIR "/Singular/"S_VERSION1 25 25 #elif defined(macintosh) … … 80 80 {"info", 'I', feResBinary,"INFO", "%b/info", ""}, 81 81 {"tkinfo", 'T', feResBinary,"TKINFO", "%b/tkinfo", ""}, 82 #ifdef WINNT 83 {"rxvt", 'X', feResBinary,"RXVT", "%b/rxvt", ""}, 84 #else 82 85 {"xterm", 'X', feResBinary,"XTERM", "%b/xterm", ""}, 86 #endif 83 87 {"Path", 'p', feResPath, NULL, "%b;$PATH", ""}, 84 88 #endif // ! defined(macintosh) … … 90 94 {"EmacsLoad",'l', feResFile, "ESINGULAR_EMACS_LOAD", "%e/.emacs-singular", ""}, 91 95 {"EmacsDir", 'e', feResDir, "ESINGULAR_EMACS_DIR", "%r/emacs", ""}, 96 #elif defined(TSINGULAR) 97 {"SingularXterm",'M',feResBinary, "TSINGULAR_SINGULAR", "%b/Singular", ""}, 92 98 #else 93 99 {"EmacsDir", 'e', feResDir, "SINGULAR_EMACS_DIR", "%r/emacs", ""}, … … 254 260 static char* feResourceDefault(feResourceConfig config) 255 261 { 262 if (config == NULL) return NULL; 256 263 char* value = (char*) AllocL(MAXRESOURCELEN); 257 264 feSprintf(value, config->fmt, -1); … … 299 306 if (executable != NULL) 300 307 { 308 #ifdef RESOURCE_DEBUG 309 printf("exec:%s\n", executable); 310 #endif 301 311 strcpy(value, executable); 312 #ifdef RESOURCE_DEBUG 313 printf("value:%s\n", value); 314 #endif 302 315 FreeL(executable); 303 316 } … … 317 330 } 318 331 } 332 333 #ifdef RESOURCE_DEBUG 334 printf("value:%s\n", value); 335 #endif 319 336 320 337 if (*value == '\0' && config->fmt != NULL ) … … 401 418 char* executable = find_executable(feArgv0); 402 419 #ifdef RESOURCE_DEBUG 403 printf("feGetExpandedExecutable: find_exec exited with =%s= \n", executable);420 printf("feGetExpandedExecutable: find_exec exited with =%s=%d\n", executable, access(executable, X_OK)); 404 421 #endif 405 422 if (executable == NULL) … … 421 438 #ifdef RESOURCE_DEBUG 422 439 printf("feVerifyResourceValue: entering with =%s=\n", value); 440 printf("%d:%d\n", access(value, R_OK), access(value, X_OK)); 423 441 #endif 424 442 switch(type) … … 449 467 { 450 468 if (value == NULL || *value == '\0') return value; 469 #ifdef RESOURCE_DEBUG 470 printf("Clean value:%s\n", value); 471 #endif 451 472 #ifdef WINNT 473 #ifdef RESOURCE_DEBUG 474 printf("Clean WINNT value:%s\n", value); 475 #endif 452 476 if (type == feResBinary) 453 477 { 454 478 int l = strlen(value); 455 if (l < 4 || strcmp(&value[l-4], ".exe") != 0) 479 if (l < 4 || (strcmp(&value[l-4], ".exe") != 0 && 480 strcmp(&value[l-4], ".EXE") != 0)) 456 481 strcat(value, ".exe"); 457 482 }
Note: See TracChangeset
for help on using the changeset viewer.