Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!rutgers!rochester!PT!cadre!jack From: jack@cadre.dsl.PITTSBURGH.EDU (Jack Nelson) Newsgroups: comp.sources.bugs Subject: tcsh for 4.3 Message-ID: <841@cadre.dsl.PITTSBURGH.EDU> Date: Tue, 6-Oct-87 16:13:22 EDT Article-I.D.: cadre.841 Posted: Tue Oct 6 16:13:22 1987 Date-Received: Fri, 9-Oct-87 21:53:57 EDT Organization: Decision Systems Lab., Univ. of Pittsburgh, PA. Lines: 74 Keywords: bug fix Here is a better fix for tw.parse.c than the one I posted yesterday; that first fix has the defect the malloc'd memory never gets freed, so data size grows too fast. This one merely makes numitems static instead of register type, so that FREE_ITEMS() at start of t_search() works correctly. The ls-F dump core after ^C is still fixed either way. Apply this patch after applying the DIFFS.2 for 4.3 recently posted. *** tw.parse.c.1 Wed Sep 30 11:52:41 1987 --- tw.parse.c Tue Oct 6 16:06:11 1987 *************** *** 1,6 **** #define MAKE_TWENEX /* flag to include definitions */ - #include "tw.h" #include "sh.h" static int maxitems = 0; char **command_list = (char **)NULL; /* the pre-digested list of commands --- 1,6 ---- #define MAKE_TWENEX /* flag to include definitions */ #include "sh.h" + #include "tw.h" /* jpn: must follow sh.h for sighold define */ static int maxitems = 0; char **command_list = (char **)NULL; /* the pre-digested list of commands *************** *** 171,178 **** *wp; /* original end-of-word */ COMMAND command; { ! register numitems, ! name_length, /* Length of prefix (file name) */ looking_for_lognames; /* True if looking for login names */ int showpathn; /* True if we want path number */ struct stat --- 171,178 ---- *wp; /* original end-of-word */ COMMAND command; { ! static int numitems; /* jpn: static for first FREE_ITEMS() */ ! register name_length, /* Length of prefix (file name) */ looking_for_lognames; /* True if looking for login names */ int showpathn; /* True if we want path number */ struct stat *************** *** 332,338 **** if (!looking_for_command) { if (looking_for_lognames) endpwent (); ! else FREE_DIR (dir_fd); } --- 332,338 ---- if (!looking_for_command) { if (looking_for_lognames) endpwent (); ! else if (dir_fd != NULL) FREE_DIR (dir_fd); } *************** *** 381,386 **** --- 381,387 ---- catn (word, extended_name, max_word_length); /* add extended name */ return d; } + else return 0; /* jpn: shouldn't occur */ } -- John P. Nelson, M.D., 3811 O'Hara St, Pittsburgh, PA 15213, t:412-624-1769 Dept. of Psychiatry, U. of Pittsburgh UUCP: { akgua | allegra | cmcl2 | idis | ihnp4 | mi-cec | pitt | psuvax1 | sun | sunrise | vax135 } ! cadre ! jack ARPA: jack@cadre.dsl.pittsburgh.edu