Changeset 2497 for neercs/trunk
- Timestamp:
- Jun 28, 2008, 1:39:10 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
neercs/trunk/src/main.c
r2496 r2497 81 81 struct screen_list *screen_list = NULL; 82 82 struct passwd *user_info; 83 char *user_path = NULL, * session_name = NULL;83 char *user_path = NULL, *user_dir = NULL, *session_name = NULL; 84 84 int i, args, s=0; 85 85 int eof = 0, refresh = 1, command = 0; … … 104 104 105 105 /* Build local config file path */ 106 user_info = getpwuid(getuid()); 107 if(user_info) 108 { 109 user_path = malloc(strlen(user_info->pw_dir) + strlen("/.neercsrc") + 1); 110 sprintf(user_path, "%s/%s", user_info->pw_dir, ".neercsrc"); 111 } 112 113 106 user_dir = getenv("HOME"); 107 if(!user_dir) 108 { 109 user_info = getpwuid(getuid()); 110 if(user_info) 111 { 112 user_dir = user_info->pw_dir; 113 } 114 } 115 if(user_dir) 116 { 117 user_path = malloc(strlen(user_dir) + strlen("/.neercsrc") + 1); 118 sprintf(user_path, "%s/%s", user_dir, ".neercsrc"); 119 } 114 120 115 121 screen_list->recurrent_list = (struct recurrent_list*) malloc(sizeof(struct recurrent_list)); … … 445 451 if(screen_list->dp) 446 452 caca_free_display(screen_list->dp); 453 447 454 cucul_free_canvas(screen_list->cv); 455 448 456 for(i = 0; i < screen_list->count; i++) 449 457 { … … 455 463 free(screen_list->socket_path); 456 464 } 465 457 466 if(screen_list->socket) 458 467 close(screen_list->socket); … … 462 471 463 472 struct option *option = screen_list->config; 464 465 473 466 474 while(option) … … 470 478 if(kromeugnon->key) free(kromeugnon->key); 471 479 if(kromeugnon->value) free(kromeugnon->value); 472 if(kromeugnon) free(kromeugnon); 473 } 474 480 free(kromeugnon); 481 } 475 482 476 483 for(i=0; i<screen_list->recurrent_list->count; i++)
Note: See TracChangeset
for help on using the changeset viewer.