Changeset 2784 for neercs/trunk/src/server.c
- Timestamp:
- Aug 27, 2008, 5:03:06 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
neercs/trunk/src/server.c
r2673 r2784 53 53 } 54 54 55 static int set_title( const char * title,struct screen_list* screen_list)55 static int set_title(struct screen_list* screen_list) 56 56 { 57 57 char buf[1024]; 58 58 int bytes; 59 char *title; 60 61 if(screen_list->attached) 62 { 63 if(screen_list->pty < screen_list->count && 64 screen_list->screen[screen_list->pty]->title) 65 title = screen_list->screen[screen_list->pty]->title; 66 else 67 title = PACKAGE_STRING; 68 } 69 70 if(screen_list->title) 71 { 72 if(!strcmp(screen_list->title, title)) 73 return 0; 74 free(screen_list->title); 75 } 76 77 screen_list->title = strdup(title); 59 78 60 79 bytes = snprintf(buf, sizeof(buf)-1, "TITLE %s", title); … … 309 328 { 310 329 refresh_screens(screen_list); 311 if(screen_list->attached) 312 { 313 if(screen_list->pty < screen_list->count && 314 screen_list->screen[screen_list->pty]->title) 315 set_title(screen_list->screen[screen_list->pty]->title, screen_list); 316 else 317 set_title(PACKAGE_STRING, screen_list); 318 } 330 set_title(screen_list); 319 331 refresh = 1; 320 332 … … 395 407 screen_list->session_name = NULL; 396 408 } 409 410 if(screen_list->title) 411 free(screen_list->title); 397 412 398 413 if(screen_list) {
Note: See TracChangeset
for help on using the changeset viewer.