Changes in global.c [ad15610:34509d5]
Legend:
- Unmodified
- Added
- Removed
-
global.c
rad15610 r34509d5 18 18 struct hostent *hent; 19 19 char hostname[MAXHOSTNAMELEN]; 20 char *cd;21 20 22 21 g->malloced=0; … … 87 86 g->homedir=owl_strdup(getenv("HOME")); 88 87 89 g->confdir = NULL;90 g->startupfile = NULL;91 cd = owl_sprintf("%s/%s", g->homedir, OWL_CONFIG_DIR);92 owl_global_set_confdir(g, cd);93 owl_free(cd);94 95 88 owl_messagelist_create(&(g->msglist)); 96 89 owl_mainwin_init(&(g->mw)); … … 326 319 } 327 320 328 char *owl_global_get_confdir(owl_global *g) {329 if (g->confdir) return(g->confdir);330 return("/");331 }332 333 /*334 * Setting this also sets startupfile to confdir/startup335 */336 void owl_global_set_confdir(owl_global *g, char *cd) {337 free(g->confdir);338 g->confdir = owl_strdup(cd);339 free(g->startupfile);340 g->startupfile = owl_sprintf("%s/startup", cd);341 }342 343 char *owl_global_get_startupfile(owl_global *g) {344 if(g->startupfile) return(g->startupfile);345 return("/");346 }347 348 321 int owl_global_get_direction(owl_global *g) { 349 322 return(g->direction); … … 545 518 len+=strlen(argv[i])+5; 546 519 } 547 g->startupargs= malloc(len+5);520 g->startupargs=owl_malloc(len+5); 548 521 549 522 strcpy(g->startupargs, "");
Note: See TracChangeset
for help on using the changeset viewer.