Changeset ae030d in git
- Timestamp:
- Feb 3, 2012, 5:08:54 PM (11 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- c2e8c5044ea364ea7100d35065206c3d3258f96a
- Parents:
- 951db29edc9cda82b668de29b5733c1ca8ed44b6
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
findexec/omFindExec.c
r951db29 rae030d 24 24 #endif 25 25 26 #ifdef WINNT27 #include <omalloc/omalloc.h>28 #endif29 30 26 /* ABSOLUTE_FILENAME_P (fname): True if fname is an absolute filename */ 31 27 #define ABSOLUTE_FILENAME_P(fname) (fname[0] == '/') … … 94 90 char *extra = NULL; 95 91 /* we are under msdos display */ 96 extra = (char*) omAlloc((search != NULL ? strlen(search) : 0) + 3);92 extra = (char*) malloc((search != NULL ? strlen(search) : 0) + 3); 97 93 strcpy(extra, ".:"); 98 94 if (search != NULL) strcat(extra, search); … … 134 130 #ifdef WINNT 135 131 if (extra != NULL) 136 omFree(extra);132 free(extra); 137 133 #endif 138 134 strcpy(executable, tbuf); -
libpolys/resources/feFopen.cc
r951db29 rae030d 9 9 #include <misc/auxiliary.h> 10 10 11 #include <omalloc/omalloc.h>12 11 #include <reporter/reporter.h> 13 12 … … 85 84 char *s; 86 85 87 if (where==NULL) s=(char *) omAlloc(250 * sizeof(char));86 if (where==NULL) s=(char *)malloc(1024); 88 87 else s=where; 89 88 … … 111 110 if (f!=NULL) 112 111 { 113 if (where==NULL) omFree((ADDRESS)s);112 if (where==NULL) free((ADDRESS)s); 114 113 return f; 115 114 } … … 120 119 f=myfopen(path,mode); 121 120 } 122 if (where==NULL) omFree((ADDRESS)s);121 if (where==NULL) free((ADDRESS)s); 123 122 } 124 123 if ((f==NULL)&&(useWerror)) -
libpolys/resources/feResource.cc
r951db29 rae030d 19 19 #include "feResource.h" 20 20 21 char* feArgv0 = NULL; 21 char* feArgv0 = NULL; 22 22 23 23 #ifdef AIX_4 … … 31 31 32 32 #include <reporter/reporter.h> 33 #include <omalloc/omalloc.h>34 33 //char* feResource(const char id, int warn = -1); 35 34 //char* feResource(const char* key, int warn = -1); … … 178 177 if (argv0==NULL) 179 178 { 180 feArgv0 = (char*) omAlloc0(MAXPATHLEN+strlen("/Singular"));179 feArgv0 = (char*)malloc(MAXPATHLEN+strlen("/Singular")); 181 180 getcwd(feArgv0, MAXPATHLEN); 182 181 strcpy(feArgv0+strlen(feArgv0),"/Singular"); 183 182 } 184 183 else 185 feArgv0 = omStrDup(argv0);184 feArgv0 = strdup(argv0); 186 185 #ifdef RESOURCE_DEBUG 187 186 printf("feInitResources: entering with argv0=%s=\n", feArgv0); … … 199 198 #endif 200 199 #ifdef HAVE_PUTENV 201 if (path != NULL) { char *s=(char *) omAlloc0(strlen(path)+6);200 if (path != NULL) { char *s=(char *)malloc(strlen(path)+6); 202 201 sprintf(s,"PATH=%s",path); 203 202 putenv(s); … … 217 216 { 218 217 if (feResourceConfigs[i].value != NULL) 219 omFree(feResourceConfigs[i].value);218 free(feResourceConfigs[i].value); 220 219 feResourceConfigs[i].value = (char *)""; 221 220 } … … 270 269 { 271 270 if (config == NULL) return NULL; 272 char* value = (char*) omAlloc(MAXRESOURCELEN);271 char* value = (char*) malloc(MAXRESOURCELEN); 273 272 feSprintf(value, config->fmt, -1); 274 273 return value; … … 302 301 printf("feInitResource: Set value of %s to =%s=\n", config->key, value); 303 302 #endif 304 config->value = omStrDup(value);303 config->value = strdup(value); 305 304 return config->value; 306 305 } … … 322 321 printf("value:%s\n", value); 323 322 #endif 324 omFree(executable);323 free(executable); 325 324 } 326 325 } … … 362 361 printf("feInitResource: Set value of %s to =%s=\n", config->key, value); 363 362 #endif 364 config->value = omStrDup(value);363 config->value = strdup(value); 365 364 return config->value; 366 365 } … … 374 373 feCleanResourceValue(config->type, value))) 375 374 { 376 config->value = omStrDup(value);375 config->value = strdup(value); 377 376 #ifdef RESOURCE_DEBUG 378 377 printf("feInitResource: Set value of %s to =%s=\n", config->key, config->value); … … 434 433 return NULL; 435 434 } 436 return omStrDup(value);435 return strdup(value); 437 436 } 438 437 … … 519 518 if (*(fn+2) == '.' && (*(fn + 3) == '/' || *(fn + 3) == '\0')) 520 519 { 521 522 523 520 #if 0 521 // this does not work: ./../../mmm will be changed to ./../mmm 522 // but we only want to change ././mmm to ./mmm 524 523 *fn = '\0'; 525 524 s = strrchr(fname, '/'); … … 533 532 *fn = '/'; 534 533 } 535 534 #endif 536 535 } 537 536 else if (*(fn+2) == '/' || *(fn+2) == '\0') … … 572 571 } 573 572 574 path_comps = (char**) omAlloc(n_comps*sizeof(char*));573 path_comps = (char**) malloc(n_comps*sizeof(char*)); 575 574 path_comps[0]=opath; 576 575 path=opath; … … 652 651 *opath = '\0'; 653 652 } 654 omFree(path_comps);653 free(path_comps); 655 654 #ifdef RESOURCE_DEBUG 656 655 Print("feCleanUpPath: leaving with path=%s=\n", opath);
Note: See TracChangeset
for help on using the changeset viewer.