Changeset a8938c7
- Timestamp:
- Jun 25, 2003, 2:04:05 AM (21 years ago)
- Branches:
- master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 591e6aa7
- Parents:
- 3733dc2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
re75713e ra8938c7 22 22 Don't allow sending to AIM users with spaces 23 23 Removed libfaim/config.log from CVS 24 Fixed some easy fixed-length buffers 24 25 25 26 2.0.4-pre-1 -
global.c
ref56a67 ra8938c7 25 25 hent=gethostbyname(hostname); 26 26 if (!hent) { 27 strcpy(g->thishost,"localhost");27 g->thishost=owl_strdup("localhost"); 28 28 } else { 29 strcpy(g->thishost,hent->h_name);29 g->thishost=owl_strdup(hent->h_name); 30 30 } 31 31 … … 35 35 g->topmsg=0; 36 36 g->needrefresh=1; 37 g->startupargs=NULL; 37 38 38 39 owl_variable_dict_setup(&(g->vars)); … … 66 67 g->searchstring=NULL; 67 68 g->starttime=time(NULL); /* assumes we call init only a start time */ 68 strcpy(g->buffercommand, "");69 g->buffercommand=NULL; 69 70 g->newmsgproc_pid=0; 70 71 … … 84 85 /* Fill in some variables which don't have constant defaults */ 85 86 /* TODO: come back later and check passwd file first */ 86 strcpy(g->homedir,getenv("HOME"));87 g->homedir=owl_strdup(getenv("HOME")); 87 88 88 89 owl_messagelist_create(&(g->msglist)); … … 228 229 229 230 void owl_global_set_buffercommand(owl_global *g, char *command) { 230 strcpy(g->buffercommand, command); 231 if (g->buffercommand) owl_free(g->buffercommand); 232 g->buffercommand=owl_strdup(command); 231 233 } 232 234 233 235 char *owl_global_get_buffercommand(owl_global *g) { 234 return(g->buffercommand); 236 if (g->buffercommand) return(g->buffercommand); 237 return(""); 235 238 } 236 239 … … 294 297 295 298 char *owl_global_get_homedir(owl_global *g) { 296 return(g->homedir); 299 if (g->homedir) return(g->homedir); 300 return("/"); 297 301 } 298 302 … … 428 432 429 433 char *owl_global_get_hostname(owl_global *g) { 430 return(g->thishost); 434 if (g->thishost) return(g->thishost); 435 return(""); 431 436 } 432 437 … … 470 475 471 476 void owl_global_set_startupargs(owl_global *g, int argc, char **argv) { 472 int i; 477 int i, len; 478 479 if (g->startupargs) owl_free(g->startupargs); 480 481 len=0; 482 for (i=0; i<argc; i++) { 483 len+=strlen(argv[i]+5); 484 } 485 g->startupargs=malloc(len+5); 473 486 474 487 strcpy(g->startupargs, ""); … … 480 493 481 494 char *owl_global_get_startupargs(owl_global *g) { 482 return(g->startupargs); 495 if (g->startupargs) return(g->startupargs); 496 return(""); 483 497 } 484 498 -
owl.h
rce7db4d ra8938c7 405 405 int recwinlines; 406 406 int typwinactive; 407 char thishost[LINE];408 char homedir[LINE];407 char *thishost; 408 char *homedir; 409 409 int direction; 410 410 int zaway; … … 412 412 int haveconfig; 413 413 int config_format; 414 char buffercommand[1024];414 char *buffercommand; 415 415 owl_editwin tw; 416 416 owl_viewwin vw; … … 418 418 int debug; 419 419 int starttime; 420 char startupargs[LINE];420 char *startupargs; 421 421 int userclue; 422 422 int nextmsgid;
Note: See TracChangeset
for help on using the changeset viewer.