ANU News Patch Patch ID: 940624_newsrc.c!bailey@genetics.upenn.edu Date: 24-Jun-1994 Author: Charles Bailey bailey@genetics.upenn.edu News Version: 6.1beta9 News Files: NewsRC.C Description: Attempts to restore context at beginning of session to newsgroup and item (if any) which were current when NewsRC file was last updated. *** newsrc.c --- newsrc_new.c ************** *** 46,48 **-- **/ --- 46,51 ----- + ** V6.1b9 24-Jun-1994 bailey@genetics.upenn.edu + ** - moved code from read_reg_file() to reg_context() to restore context + ** to group+item at which last session ended. **-- **/ ************** *** 72,78 old_dir_lev, force_dir = 0; ! static int dotnewsrcexists = 0; extern int lib$put_output(); --- 75,81 ----- old_dir_lev, force_dir = 0; ! static char new_cg_name[SUBJLEN]; static int dotnewsrcexists = 0; ************** *** 74,79 static int dotnewsrcexists = 0; extern int lib$put_output(); /* --- 77,84 ----- static char new_cg_name[SUBJLEN]; + static int dotnewsrcexists = 0; + extern int lib$put_output(); /* ************** *** 149,156 int read_reg_file() { ! char *in_line, *itm_list, new_name[128], *old_dir_typ; ! int systime, f_itm, l_itm, g = 0, ca_i = 1, ca_msize, new_cg; FILE *dotnewsrc; GRP_PTR l_ga, *ca; --- 154,161 ----- int read_reg_file() { ! char *in_line, *itm_list, *old_dir_typ; ! int systime, f_itm, l_itm, g = 0, ca_i = 1, ca_msize; FILE *dotnewsrc; GRP_PTR l_ga, *ca; ************** *** 244,250 ++in_line; } #endif ! if ((new_vals = sscanf(in_line,"%X %s %d",&systime,new_name,&new_ci)) >= 1) sys_reg_time = systime; while ((in_line = fgetl(newsrc)) != 0) { if (!strlen(in_line) || in_line[0] == '\n') continue; --- 249,255 ----- ++in_line; } #endif ! if ((new_vals = sscanf(in_line,"%X %s %d",&systime,new_cg_name,&new_ci)) >= 1) sys_reg_time = systime; while ((in_line = fgetl(newsrc)) != 0) { if (!strlen(in_line) || in_line[0] == '\n') continue; ************** *** 356,363 } if (fclose(newsrc)) _ck_close(newsrc); newsrc = 0; - if ((new_vals >= 2) && (new_cg = ga_exact_name(new_name))) curr_g = new_cg; - else new_vals = 2; set_level(1); if (profile_filter && !reorder_groups) { --- 361,366 ----- } if (fclose(newsrc)) _ck_close(newsrc); newsrc = 0; set_level(1); if (profile_filter && !reorder_groups) { ************** *** 457,463 if (g < ca_i) ga[g] = ca[g]; } ga_size = ca_i - 1; - curr_g = ga_exact_name(new_name); } sysprv(); --- 460,465 ----- if (g < ca_i) ga[g] = ca[g]; } ga_size = ca_i - 1; } sysprv(); ************** *** 498,504 int reg_context() { ! int i; ITM_PTR iap; struct dir_class *ch = c_head; --- 500,506 ----- int reg_context() { ! int i, new_cg = 0; ITM_PTR iap; struct dir_class *ch = c_head; ************** *** 515,520 } } if (smg_active) { if (force_dir) do_dir(force_dir,0); else { --- 517,525 ----- } } + if ((new_vals >= 2) && (new_cg = ga_exact_name(new_cg_name))) curr_g = new_cg; + else new_vals = 2; + if (smg_active) { if (force_dir) do_dir(force_dir,0); else { ************** *** 538,543 if ((!*profile_dirstr) && old_dir_lev) do_dir(old_dir_lev,curr_class != (struct dir_class *) 0); } } if ((new_vals == 3) && (ga[curr_g]->grp_count)) { --- 543,552 ----- if ((!*profile_dirstr) && old_dir_lev) do_dir(old_dir_lev,curr_class != (struct dir_class *) 0); } + if (new_cg && !ga[new_cg]->grp_display_indx) { + if (ga[new_cg]->grp_reg) do_dir(DIR_REGISTER + 1,0); + else do_dir(DIR_ALL + 1,0); + } } if (new_cg) cur_set_grp(new_cg); ************** *** 540,545 } } if ((new_vals == 3) && (ga[curr_g]->grp_count)) { set_level(2); if (new_ci <= ga[curr_g]->grp_ia[1].itm_num) --- 549,555 ----- } } + if (new_cg) cur_set_grp(new_cg); if ((new_vals == 3) && (ga[curr_g]->grp_count)) { set_level(2); if (new_ci <= ga[curr_g]->grp_ia[1].itm_num) *** patchlist.h;-1 --- patchlist.h ************** *** 1,1 =+=+= End =+=+= --- 1,2 ----- + 940624_newsrc.c!bailey@genetics.upenn.edu =+=+= End =+=+=