Changeset d3941a0
- Timestamp:
- Feb 4, 2011, 3:49:44 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- 65c753e
- Parents:
- b03c714
- git-author:
- David Benjamin <davidben@mit.edu> (01/24/11 17:14:08)
- git-committer:
- David Benjamin <davidben@mit.edu> (02/04/11 15:49:44)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
global.c
r5f8ec6b rd3941a0 527 527 /* startup args */ 528 528 529 void owl_global_set_startupargs(owl_global *g, int argc, const char *const *argv) { 530 int i, len; 531 529 void owl_global_set_startupargs(owl_global *g, int argc, char **argv) { 532 530 if (g->startupargs) owl_free(g->startupargs); 533 534 len=0; 535 for (i=0; i<argc; i++) { 536 len+=strlen(argv[i])+5; 537 } 538 g->startupargs=owl_malloc(len+5); 539 540 strcpy(g->startupargs, ""); 541 for (i=0; i<argc; i++) { 542 sprintf(g->startupargs + strlen(g->startupargs), "%s ", argv[i]); 543 } 544 g->startupargs[strlen(g->startupargs)-1]='\0'; 531 g->startupargs = g_strjoinv(" ", argv); 545 532 } 546 533 -
owl.c
rb03c714 rd3941a0 454 454 int main(int argc, char **argv, char **env) 455 455 { 456 int argc save;457 c onst char *const *argvsave;456 int argc_copy; 457 char **argv_copy; 458 458 char *perlout, *perlerr; 459 459 const owl_style *s; … … 464 464 g_error ("GLib version 2.12.0 or above is needed."); 465 465 466 argc save=argc;467 argv save=strs(argv);466 argc_copy = argc; 467 argv_copy = g_strdupv(argv); 468 468 469 469 setlocale(LC_ALL, ""); … … 483 483 if (opts.confdir) owl_global_set_confdir(&g, opts.confdir); 484 484 owl_function_debugmsg("startup: first available debugging message"); 485 owl_global_set_startupargs(&g, argcsave, argvsave); 485 owl_global_set_startupargs(&g, argc_copy, argv_copy); 486 g_strfreev(argv_copy); 486 487 owl_global_set_haveaim(&g); 487 488
Note: See TracChangeset
for help on using the changeset viewer.