1 Thu Jun 15 11:02:06 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
3 * made pdksh-5.2.3 distribution
5 * c_ksh.c(c_whence): search keyword table if vflag set.
7 * tree.h(DOVACHECK): new define.
8 * eval.c(expand): check DOVACHECK flag.
9 * exec.c(execute): when calling eval(), or in t->evalflags.
10 * syn.c(get_command): set evalflags to DOVACHECK instead of DOASNTILDE.
12 Wed Jun 14 09:27:19 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
14 * c_ksh.c(c_cd): two argument format: use current_wd, not path
15 when appending elen bytes.
16 (fix from Gabor Zahemszky).
18 Tue Jun 13 15:54:11 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
20 * history.c(c_fc): if last not specified and !-l, use first as last.
22 * eval.c(maybe_expand_tilde): allow CSUBST to end tilde word.
24 * misc.c(gmatch): made sc and pc unsigned.
26 Fri Jun 2 11:55:40 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
28 * configure.in: added flock to AC_CHECK_FUNCS call.
29 * conf-end.h: undef COMPLEX_HISTORY if !HAVE_FLOCK.
31 Tue May 30 20:38:47 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
33 * sh.h(SEEK_SET,SEEK_CUR,SEEK_END): define if not defined.
34 * history.c: change L_XTND to SEEK_END.
36 Tue May 30 17:01:34 NDT 1995 John Rochester (jr@panda.cs.mun.ca)
38 * shf.c(shf_seek): new function.
39 * shf.h(shf_seek): new prototype.
41 Tue May 30 16:42:41 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
43 * aclocal.m4(KSH_DEV_FD): new test.
44 * acconfig.h(HAVE_DEV_FD): new define.
45 * configure.in: call KSH_DEV_FD.
47 * c_test.h(TO_FILAXST): new enum.
48 * c_test.c(test_stat,test_eaccess): new functions for /dev/fd/n
50 * c_test.c(test_evalop): call test_stat() and test_eaccess()
51 instead of stat() and eaccess() in most places; added case
54 Tue May 30 16:06:21 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
56 * aclocal.m4(KSH_MEMMOVE): fixed test so copies overlap.
58 Sun May 28 11:11:03 NDT 1995 John Rochester (jr@panda.cs.mun.ca)
60 * sh.h(safe_prompt): new variable.
61 * main.c(initsubs): removed PS1.
62 * main.c(main): initialize safe_prompt; initialize PS1 from
64 * lex.c(set_prompt): create new env while expanding PS1 - if expansion
65 fails, use safe_prompt.
67 Sat May 27 20:59:02 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
69 * exec.c: put comments around token after #endif.
71 Thu May 25 10:10:45 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
73 * c_test.c(test_eval): case TO_OPTION: negate test if option starts
74 with a !, always fail if option doesn't exist.
76 * sh.h(FNOHUP): new define.
77 * misc.c(options[]): "nohup" new option.
78 * jobs.c(j_stopped,j_stopped_running): name of j_stopped changed
79 to j_stopped_running; changed all calls; check for/warn about
80 running jobs if appropriate.
81 * jobs.c(j_exit): check for/kill running jobs if appropriate.
82 * main.c(shell),c_sh.c(c_exit): un-ifdef JOBS the j_stopped_running()
83 call and really_exit initialization/clearing.
85 Wed May 24 10:06:14 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
87 * options.h(DEFAULT_ENV): new define.
88 * main.c(main): if ENV isn't set and DEFAULT_ENV is defined, include
90 (based on patches from Dave Kinchlea).
92 * sh.h(LAEXPR): new define.
93 * expr.c(evaluate): changed return type to error indicator; added
94 rval and error_ok arguments; changed all calls (c_sh.c(c_shift),
95 c_ulimit.c(c_ulimit),eval.c(expand),var.c(global,local)).
96 * expr.c(v_evaluate): added error_ok argument; changed return value
97 to error indicator; call unwind() if !error_ok.
98 * expr.c(evalerr): changed errorf() to warningf(); call unwind(LAEXPR).
99 * c_test.c(test_eval): merged code for integer operations to have
100 two calls to evaluate().
102 * io.c(warningf): print trailing newline; changed all calls.
104 * history.c(hist_get): string search: use histptr, not histptr - 1.
106 Tue May 23 11:07:50 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
108 * sh.h(GI_NONAME): new define.
109 * misc.c(ksh_getopts): honour GI_NONAME flag.
110 * c_ksh.c(getopts_reset): set GI_NONAME flag.
112 * exec.c(comexec): don't change $0 if FPOSIX flag set.
114 * misc.c(ksh_getopt): don't use GI_DONE to allow parsing past
116 * sh.h(GI_DONE): deleted define.
118 * var.c(unset): added array_ref parameter; unset/free whole array
119 if not an array_reference; changed all calls.
120 * c_sh.c(c_unset): set array_ref parameter if there is a [ in the name.
122 Mon May 22 10:33:14 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
124 * history.c(hist_init): complex version: initialize hist_source
125 (fix from Simon J. Gerraty).
127 Sat May 20 11:06:15 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
129 * made pdksh-5.2.2 distribution
131 * Makefile.in: added c_test.h to HDRS.
133 Fri May 19 12:35:18 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
135 * made pdksh-5.2.1 distribution
137 * emacs.c(v_version): ignore typed character if it is a space.
138 * emacs.c(x_emacs_keys): bind <ESC>erase-char to delete-back-word
139 (was delete-back-char).
140 * emacs.c(x_defkeybindings[]): bound list-file to ^X^Y and
141 newline-and-next to ^O, as per man page.
143 * c_ksh.c(c_whence): changed "is a keyword" to "is a reserved word".
145 * sh.h: changed SVSV_PGRP to SYSV_PGRP.
147 * vi.c(vi_cmd): uncommented case for ^[ to make it easy to enable
150 Mon May 15 15:25:22 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
152 * history.c(c_fc): accept -40 as -- -40.
153 * main.c(initcoms[]): take -- out of history alias.
155 * vi.c(print_expansions): handle trailing slash correctly (don't
156 print empty strings).
158 * c_ksh.c(c_cd): put back ksh_get_wd() call for os/2.
160 * misc.c(ksh_get_wd): changed buf to b in call to getcwd().
162 Tue May 9 13:57:31 NDT 1995 Michael Rendell (michael@dragon.cs.mun.ca)
164 * c_test.h: new file.
165 * c_test.c: major code restructuring: common parsing/evaluation
166 routines call/called-by three sets of routines: one for
167 normal test (and [..]), one for parsing [[ .. ]] one for
169 * c_test.c(oexpr,aexpr,nexpr,primary,is_op): renamed to test_oexpr,
170 test_aexpr, test_nexpr, test_primary, test_isop.
171 * c_test.c(eval_unop,eval_binop): combined into new test_eval function.
172 * c_test.c(syntax): renamed to ptest_error,
173 * c_test.c(ptest_isa,ptest_getopnd,ptest_eval): new functions.
174 * syn.c(syntaxerr): added extra arg; changed all calls.
175 * syn.c(db_parse,db_oaexpr,db_nexpr,db_primary): deleted.
176 * syn.c(dbtestp_isa,dbtestp_getopnd,dbtestp_eval,dbtestp_error): added.
177 * syn.c(get_command): case DBRACKET: changed to call new routines.
178 * tree.c(ptree): case DBRACKET: changed.
179 * exec.c(execute): case DBRACKET: changed.
180 * exec.c(dbteste_isa,dbteste_getopnd,dbteste_eval,dbteste_error): added.
182 Fri May 5 17:10:23 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
184 * emacs.c(compl_file,compl_command): fixed buffer growing code.
186 Thu May 4 22:44:01 NDT 1995 Michael Rendell (michael@garfield.cs.mun.ca)
188 * aclocal.m4(KSH_UNISTD_H): include <sys/types.h> and only include
189 <dirent.h> if HAVE_DIRENT_H is defined.
191 Thu May 4 21:19:15 NDT 1995 Michael Rendell (michael@garfield.cs.mun.ca)
193 * c_ksh.c: include "ksh_stat.h".
194 * c_ksh.c(c_cd): don't do physical chdir if S_ISLNK not defined.
196 Wed May 3 10:08:32 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
198 * made pdksh-5.2.0 distribution
200 * misc.c: include <ctype.h>.
201 * misc.c(gmatch): added isfile argument; changed all calls.
202 * sh.h(FILECHCONV): (os2 version) - use isupper.
203 * emacs.c(strmatch): don't increment in FILECHCONV.
205 * aclocal.m4(KSH_HEADER_SYS_WAIT): new macro.
206 * configure.in: use KSH_HEADER_SYS_WAIT instead of AC_HEADER_SYS_WAIT.
207 * ksh_wait.h: if POSIX_SYS_WAIT not defined, undef W* macros.
209 Tue May 2 12:10:39 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
211 * emacs.c,emacs-gen.sh,emacs-c.in,emacs.out,Makefile.in: changed emacs
212 source munging to create emacs.out which is included by emacs.c
213 rather then munging emacs.c itself.
215 * lex.c(pprompt): flush shl_out.
217 * vi.c(glob_word): if path has *?[, don't add * (was if last component).
219 * emacs.c(x_search_char): renamed to x_search_char_forw.
220 * emacs.c(x_search_char_back): new function; bound to ^[^].
222 * sh.h: changed SVR3_PGRP to SYSV_PGRP.
223 (fixes from Gabor Zahemszky).
225 Tue May 2 10:09:57 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
227 * c_ksh.c(c_cd): deleted OS2 ifdefs.
228 * path.c(make_path): use ISRELPATH instead of ISABSPATH
229 * path.c(simplify_path): use ISROOTEDPATH instead of ISABSPATH.
230 * sh.h(ISABSPATH,ISROOTEDPATH,ISRELPATH): changed/new defines.
232 * aclocal.m4(AC_LANG_C,AC_LANG_CPLUSPLUS,AC_TRY_RUN): copied
233 from autoconf's acgeneral.m4, changed to handle .exe suffix.
234 * aclocal.m4(KSH_OS_TYPE): os2 case: set $ac_exe_suffix.
235 * configure.in: substitute ac_exe_suffix.
236 * Makefile.in: changed references to E to exe_suffix, set to
239 * c_ksh.c(c_cd): ifdef S_ISLNK second use of get_phys_path().
240 * edit.c(x_mode): removed ifndef OS2.
241 (fixes from Dale DePriest)
242 * exec.c(search_access1): add .sh to suffix lists.
243 * vi.c(vi_insert,vi_hook): OS2: changes to allow arrow keys work
246 Mon May 1 16:28:44 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
248 * path.c(ksh_get_wd): getcwd() case, return alloc'd buffer, not
251 Mon May 1 09:41:56 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
253 * aclocal.m4: changed HAVE_SYS_RESOURCES_H to HAVE_SYS_RESOURCE_H.
255 * aclocal.m4(KSH_OS_TYPE): new macro.
256 * aclocal.m4(KSH_OS2_EMX): deleted.
257 * configure.in: deleted calls to AC_AIX,AC_MINIX,AC_ISC_POSIX,
258 KSH_OS2_EMX; replaced with KSH_OS_TYPE.
259 * acconfig.h(OS_ISC,OS_SCO): new undefs.
260 * sh.h: changed use of isc386 to OS_ISC
261 * edit.c: changed use of M_UNIX to OS_SCO.
263 Sat Apr 29 21:10:54 NDT 1995 Michael Rendell (michael@garfield.cs.mun.ca)
265 * vi.c(glob_word): don't append * if there are unescaped globing
266 characters in the last component of the filename; some redundent
268 (based on fix from Michael Jetzer).
270 Fri Apr 28 16:10:22 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
272 * eval.c(globit): save/restore actual DIRSEP char - don't use DIRSEP.
274 * c_ulimit.c: removed ARGS from declaration of ulimit to avoid
275 portability problems (osf/1 has ulimit(int,...), os2 has
278 * tty.c(tty_init): added __SCO__ defines to avoid opening /dev/tty.
280 * configure.in,aclocal.m4,acconfig.h: added KSH_OS2_EMX test.
281 * os2/config.h, os2/configure.cmd, os2/make.sed: updated for new
284 Tue Apr 25 12:20:45 NDT 1995 Michael Rendell (michael@dragon.cs.mun.ca)
286 * configure.in: added sys/param.h test; changed getcwd test to getwd.
287 * c_ksh.c(c_pwd): new function.
288 * sh.h(current_wd, current_wd_size): new variables.
289 * c_ksh.c(c_cd): changed to handle -L, -P.
290 * main.c(main): use set_current_wd when setting $PWD;
291 instead of changing to / when can't get pwd, print warning;
292 deleted pwd alias; don't make PWD and OLDPWD reaedonly.
293 * path.c(simplify_path): changed to handle relative paths.
294 * path.c(make_path): added phys_path argument to support cd -P.
295 * path.c(set_current_wd,get_phys_path,do_phys_path): new functions.
296 * misc.c(ksh_get_wd): new function.
297 * missing.c(getcwd): deleted.
298 * misc.c(options[]),sh.h: added "physical", FPHYSICAL.
300 Mon Apr 24 14:33:03 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
302 * shf.c(shf_smprintf): new function.
304 * expand.h(Xsize): new define.
306 Fri Apr 21 21:22:44 NDT 1995 Michael Rendell (michael@garfield.cs.mun.ca)
308 * sh.h: changed SIZEOF_long to SIZEOF_LONG.
309 * exec.c(scriptexec): if OS2 ifdefed code, changed ISDIRSEP to
312 Thu Apr 20 21:18:12 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
314 * history.c(hist_get) if n < 0, use n + 1 to account for histbackup().
316 * lex.c(set_prompt): added source argument; changed all calls;
317 changed to do ! and !! substitutions when setting PS1.
318 * lex.c(pprompt): ifdef'd out code to deal with ! and !!.
320 * shf.c(shf_puts): new routine.
321 * exec.c(herein), lex.c(getsc_): changed to use shf_puts.
323 Thu Apr 20 15:50:35 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
325 * siglist.sh: clear traps in subshell to cover for bug in bash 1.4.3
326 (based on fix from Fritz Heinrichmeyer).
328 Wed Apr 19 12:04:59 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
330 * vi.c(classify): cleaned up table; filled in U_ flag for commands
331 that don't modify things.
332 * vi.c(first_insert, saved_inslen): new variables.
333 * vi.c(vi_reset): don't reset yanklen, inslen, lastcmd, lastac;
334 set first_insert, saved_inslen.
335 * vi.c(vi_insert): added code to handle first insertion to allow
336 redoing commands from last edit.
337 (based on fixes from Michael Jetzer).
339 * vi.c(VVERSION): new state.
340 * vi.c(classify): cleared C_ flag for 032 (^Z); set it for ^V.
341 * vi.c(nextstate): added VVERSION.
342 * vi.c(vi_hook): cases for VVERSION.
343 * sh.h(ksh_version): new declaration; removed declaration from
346 * Makefile.in: removed rcs-ci, rcs-diff targets; put RCSFILES
347 into DISTFILES and removed former.
349 * var.c(newblock): copy argc/argv from previous env if it exists.
351 Tue Apr 18 23:10:32 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
353 * jobs.c(exchild): report internal error if execute() returns in child.
354 * exec.c(execute): case TASYNC: clear exec flag in call to execute().
356 Tue Apr 18 12:05:23 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
358 * emacs.c(x_bind): added list argument.
359 * c_ksh.c(c_bind): added -l (list) option.
361 * emacs.c,emacs-c.in: moved emacs.c to emacs-c.in.
362 * Makefile: add rule to create emacs.c from emacs-c.in.
363 * emacs-gen.sh: new file.
364 * emacs.c(struct x_defbindings, x_defbindings[]): new struct/array.
365 * emacs.c(struct x_ftab, x_ftab[]): removed x_db_tab, x_db_char;
366 initialize x_ftab[] via script.
367 * emacs.c(x_init_emacs): changed to load key bindings from
369 * emacs.c(Findex): added typedef.
370 * emacs.c(x_tab[]): changed to index into x_ftab; changed all refernces.
371 * emacs.c(xft_*): changed to XFUNC_*.
372 * emacs.c(XF_PREFIX): new flag, used for x_meta1, 2, 3.
373 * emacs.c(KPREF,KNULL): deleted (no functional use), changed
375 * emacs.c(x_last_command): changed type to Findex.
376 * emacs.c(x_emacs): set x_last_command to 0 at start; removed
379 * emacs.c(XF_ARG): new flag for struct ftab.
380 * emacs.c(x_ftab[]): filled in XF_ARG for appropriate commands.
381 * emacs.c(x_arg_defaulted): new variable.
382 * emacs.c(x_emacs,x_set_arg): set x_arg_defaulted.
383 * emacs.c(x_bword, x_fword,x_fold_case): removed use of x_last_command.
384 * emacs.c(x_fold_upper,x_fold_lower,x_fold_capitailze): trivial
385 functions that call x_fold_case; changed x_ftab[] to use these
386 instead of x_fold_case so arbitrary keys can be bound to them.
387 * emacs.c(x_fold_case): changed to assume argument is 'L', 'U', or 'C'.
388 * emacs.c(x_del_back,x_del_char,x_prev_histword,x_prev_com,x_next_com,
389 x_kill,x_insert): use x_arg and x_arg_defaulted.
390 * emacs.c(x_delete): don't change mark point (xmp) if <= cp; added
391 force_push argument; changed all calls.
393 Mon Apr 17 10:30:12 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
395 * emacs.c(x_e_getc): changed to handle macroptr, ungetting characters.
396 * emacs.c(x_e_ungetc): new function.
397 * emacs.c(x_emacs): let x_e_getc() take care of macroptr.
398 * emacs.c(x_version,x_search_hist): use x_e_ungetc() instead of
400 * emacs.c(x_set_arg): handle string of digits.
402 * emacs.c(x_search_hist): handle deleting chars from search string.
403 (fix from Dale DePriest)
404 * emacs.c(x_search): added sameline paramater.
405 * emacs.c(x_search_list): changes x_zots() to x_e_puts(); make
406 deleting in empty pattern break out of search.
408 * vi.c(domove): case '%': adjust ncursor forward only if matching
409 opening bracket (so when cursor is on the B in "(fooBar)", c%
410 changes the openbracket as well.
411 * vi.c(vi_cmd): case y/d/c: special case to move end point ahead
412 if move cmd is % and match was to the left of the cursor.
414 Thu Apr 13 10:34:26 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
416 * vi.c(complete_word): no bell on ambiguous matches (user can
417 tell its ambiguous 'cause there is not space or slash appended)
419 * configure.in,aclocal.m4: added KSH_MEMMOVE, KSH_MEMSET tests
420 to fix problems with compiler builtins.
422 * misc.c(blocking_read, reset_nonblock) new routines.
423 * sh.h: deleted O_NONBLOCK ifdefs/defines.
424 * main.c(main),lex.c(getsc_),edit.c(x_getc),shf.c(shf_fillbuf):
425 use reset_nonblock().
426 (fix based on code from John Rochester)
428 Tue Apr 11 14:36:22 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
430 * history.c(c_fc): mostly POSIXized.
431 * history.c(hist_execute,hist_get_newest,hist_get_oldest): new routines.
432 * history.c(hist_get,histget): changed histget to hist_get.
433 * history.c(hist_replace,histrpl): changed histrpl to hist_replace.
434 * lex.h(SHIST,histpush): deleted; deleted all references.
435 * history.c(histget): add approx check for history that hasn't
438 * misc.c(getn): allow leading plus (eg, +3).
440 * main.c(initcoms[]): defined history as "fc -l --".
442 * conf-end.h(JOBS): don't define if no posix or bsd process groups
443 (was if SIGCONT not defined).
445 Mon Apr 10 14:51:54 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
447 * exec.c(comexec),c_ksh.c(c_getopts),c_sh.c(c_read): use FEXPORT flag.
449 * ksh_wait.h: changed to work with autoconf 2.x AC_HEADER_SYS_WAIT -
450 if sys/wait.h uses union wait, don't include it.
452 Thu Apr 6 12:19:58 NDT 1995 Michael Rendell (michael@panda.cs.mun.ca)
454 * tty.c(tty_init): print warning if open of /dev/tty fails.
456 Sat Mar 4 01:20:03 NST 1995 Michael Rendell (michael@garfield.cs.mun.ca)
458 * io.c(maketemp): create valid dos filenames.
460 Mon Feb 27 11:04:32 NST 1995 Michael Rendell (michael@panda.cs.mun.ca)
462 * Changed from autoconf 1.x to autoconf 2.x.
463 * acconfig.h: included old config.h.top and config.h.bot.
464 * config.h.top, config.h.bot: deleted; deleted all references.
465 * install.sh: changed to install-sh; changed all references.
466 * Makefile.in: use @CPPFLAGS@, @CFLAGS@, @LDFLAGS@;
467 use @configure_input@; remove config.log and config.cache in
468 distclean; use @prefix@ and @exec_prefix@.
469 * ksh_dir.h: changed to use new autoconf defines; changed NLENGTH()
470 to NAMLEN(); changed all references.
472 Mon Feb 27 9:31:02 NST 1995 Michael Rendell (michael@panda.cs.mun.ca)
474 * sh.h(ISABSPATH): new macro.
475 * var.c(setspec): use ISABSPATH() when setting tmpdir.
477 * emacs.c(compl_file): added OS2 ifdefs.
478 * exec.c(scriptexec): OS2: ignore path specified in #! scripts.
479 * sh.h(ksh_dupbase): OS2: now same as unix.
480 * trap.c(sigtraps[],inittraps): remove OS2 defines.
481 * trap.c(alarm_catcher): V7_SIGNALS: use sig, not i.
482 (Fixes from Dale DePriest)
484 Mon Feb 27 10:06:00 NST 1995 Michael Rendell (michael@panda.cs.mun.ca)
486 * configure.in: test for resource.h.
487 * c_ulimit.c: include ksh_time.h instead of sys/time.h; use
488 HAVE_SYS_RESOURCE_H when including sys/resource.h
489 (was HAVE_SETRLIMIT).
490 * aclocal.m4(KSH_RLIM_T): check sys/resources.h for rlim_t.
492 Fri Feb 24 17:30:16 NST 1995 Michael Rendell (michael@panda.cs.mun.ca)
494 * vi.c(struct macro_state, macro): new structure/variable.
495 * vi.c(vi_hook, vi_cmd): use macro state info to allow nested macros,
496 detect recursive macros.
498 Wed Feb 22 21:20:43 NST 1995 Michael Rendell (michael@panda.cs.mun.ca)
500 * c_ksh.c(c_whence): "an export" instead of "a export".
501 * vi.c(classify[]): added @<char>.
502 * vi.c(vi_hook,vi_cmd): added support for @<char> (macros).
503 (fixes from Frank Edwards).
505 Sun Feb 19 11:57:20 NST 1995 Michael Rendell (michael@panda.cs.mun.ca)
507 * exec.c(comexec): case CFUNC: use cp (not tp->name) when checking if
508 an autoloaded function was defined; save/restore kshname before/after
510 * var.c(popblock): don't set kshname to e->loc->argv[0] - it isn't
513 Fri Feb 10 12:36:16 NST 1995 Michael Rendell (michael@panda.cs.mun.ca)
515 * misc.c(parse_args): check OF_SET when building set_opts (was
516 checking OF_CMDLINE).
518 * conf-end.h(JOBS): don't define if SIGCONT not defined.
520 * sh.h(FLOGIN) new enum.
521 * misc.c(options[],parse_args): added login option; set FLOGIN if
522 name in argv[0] starts with -.
523 * main.c(main): use FLOGIN flag; changed the way OS2 code looks
526 Wed Feb 1 09:55:40 NST 1995 Michael Rendell (michael@panda.cs.mun.ca)
528 * expr.c(varsub): in FUNSET test, don't always fail # and %
529 substitutions (test for unset variable).
531 Wed Jan 25 09:22:15 NST 1995 Michael Rendell (michael@panda.cs.mun.ca)
533 * sh.h(MIN_COLS): new define.
534 * sh.h(MIN_EDIT_SPACE): new define.
535 * vi.c(prompt_trunc): new variable.
536 * vi.c(edit_resize): calculate how much of prompt to truncate.
537 * lex.c(pprompt): added new argument; changed all calls.
538 * lex.c(yylex),emacs.c(x_emacs),vi.c(x_vi): move pprompt() inside
539 x_emacs(), x_vi() or just before read in yylex().
541 Tue Jan 24 12:35:18 NST 1995 Michael Rendell (michael@panda.cs.mun.ca)
543 * misc.c(parse_args): changed arrayname variable to array.
544 * var.c(basename): changed name of function to arrayname();
545 changed all references (Based on fix from Dan Quinlan).
547 Fri Dec 30 10:34:50 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
549 * ksh.1: modifications to generate two man pages: sh and ksh
550 (Fixes from Michael Harrdt).
552 Wed Dec 28 16:55:13 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
554 * vi.c(complete_word): don't check for globing characters.
556 Wed Dec 28 10:32:18 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
558 * exec.c(search_access1): don't use ret variable; move "." to end
559 of xsuffixes/rsuffixes.
560 * os2.c(_execve): OS2: fixed typo.
561 * sh.h(FILENCMP): changed stricmp to strnicmp.
562 * os2/config.h: added define for rlim_t.
563 * os2/make.sed: changed > null to > nul.
564 * Makefile.in(dist): generate os2/makefile after running Dist-fixup.
565 (Fixes from Dale DePriest)
567 Thu Dec 22 15:06:06 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
569 * made pdksh-5.1.3 distribution
571 * *.c: removed RCSids.
573 Wed Dec 21 11:55:01 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
575 * table.h(struct tbl): changed array field to union of array/fname;
576 changed all references.
577 * c_ksh.c(c_whence): print undefined function path.
578 * exec.c(comexec): do autoloading of undefined functions; print
579 error if function can't be found.
580 * exec.c(findcom): fill in tp->u.fname for undefined functions;
581 search FPATH if search of PATH fails.
582 * table.h(FC_NOAUTOLOAD): deleted define; removed all references.
584 Tue Dec 20 14:16:16 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
586 * exec.c(herein): check if name is null.
587 * lex.h(HEREDELIM,SHEREDELIM,SHEREDQUOTE): new defines.
588 * lex.c(yylex): added code for HEREDELIM.
589 * syn.c(synio): use HEREDELIM.
590 * lex.c(readhere): changed to allow \n in here-delimiter.
592 * tree.c(tputS): quote ", ` and $ inside "-quotes.
593 * tree.c(ptree,pioact): made static.
594 * tree.c(ptree,fptreef,vfptreef): added indent argument; changed to
595 use indent argument; changed all calls.
596 * tree.h(struct ioword): added delim field.
597 * tree.c(iocopy),syn.c(synio,syntaxerr): deal with delim field.
598 * tree.c(pioact): print contents of here documents.
600 * c_ksh.c(c_typeset): typeset -f foo: set exit code to 1 if function
603 Mon Dec 19 15:14:02 NST 1994 Michael Rendell (michael@garfield.cs.mun.ca)
605 * history.c(histinit): increment line number for each history line.
607 * exec.c(iosetup): OS2: if open /dev/null fails, try nul instead.
608 * Makefile.in(debugtools,install,uninstall): make check-pgrp last;
610 * eval.c(eval,expand): OS2: added DODIRSWP code.
611 * main.c(main): OS2: only include $HOME/kshrc.ksh if interactive.
612 * sh.h(FILENCMP,FILECMP,FILECHCONV): new defines.
613 * misc.c(gmatch),vi.c(grabsearch,complete_word),emacs.c(compl_file):
614 OS2: case insensitive compares.
615 (fixes from Dale DePriest).
617 Mon Dec 19 09:54:42 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
619 * vi.c(vi_cmd): make ~ honour argcnt (fix from Troy Bollinger).
621 * vi.c(complete_word): don't add trailing / if there is already one.
622 * vi.c(glob_word): return rval, not 0.
624 Thu Dec 15 11:06:01 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
626 * vi.c(vi_cmd): call complete_word() with argument of 1 not 0.
628 Tue Dec 13 12:07:50 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
630 * history.c(histget): made static; added approx argument; changed
633 Tue Dec 13 10:58:14 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
635 * Makefile.in(mandir): use $(manext), not 1 (fix from Mike Long).
637 Mon Dec 12 20:55:53 NST 1994 John Rochester (jr@panda.cs.mun.ca)
639 * tree.c(ptree): print TELIF part of if statements
641 Fri Dec 9 15:21:36 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
643 * trap.c(inittraps): OS2: don't trap SIGTERM (temproary fix).
645 * exec.c(search_access1): OS2: fixed to check for valid suffix
646 and change mode from X_OK to R_OK if appropriate.
648 * edit.c: include <sys/stream.h>, <sys/ptem.h> for SCO unix
649 (fix from William Bader).
651 * c_ulimit.c(c_ulimit): changed type of val from long to rlim_t
652 (fix from Thomas Gellekum and J.T.Conklin).
653 * aclocal.m4(KSH_RLIM_T): new test for rlim_t.
654 * configure.in: use KSH_RLIM_T.
655 * acconfig.h: added rlim_t.
657 Thu Dec 8 12:20:25 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
659 * expr.c(evalexpr): changed div-by-zero test to only derefernce vr
660 if operation is a divide.
662 Mon Dec 5 14:42:52 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
664 * exec.c(search): OS2: typo - changed namlen to namelen.
665 * exec.c(search_access): OS2: check execute bit explicitly.
666 * main.c(main): OS2: don't include ./profile.ksh.
667 * options.h(DEFAULT_PATH): OS2: added /os2 to path.
668 * sh.h(ksh_getdup): OS2: define to getdup(); prototype for getdup().
669 * Makefile.in(dist): create os2 Makefile based on distribution
672 Mon Dec 5 12:17:14 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
674 * made pdksh-5.1.2 distribution
676 * eval.c(globit): when searching directory, re-calculate end of
677 string based on prefix length.
679 Fri Dec 2 11:07:48 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
681 * syn.c(wordlist): if token isn't 'in', don't reject ;.
683 * eval.c(expand): leading non-white-space IFS chars no cause initial
686 Thu Dec 1 12:04:00 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
688 * made pdksh-5.1.1 distribution
690 Thu Dec 1 10:50:38 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
692 * sh.h(TF_FATAL,fatal_trap): new define,variable.
693 * trap.c(inittraps,trapsig,fatal_trap_check,trap_pending,runtrap,
694 settrap): use TF_FATAL, fatal_trap.
695 * trap.c(runtraps): changed argument from bool to TF_* flag; changed
697 * jobs.c(j_waitj): check fatal_trap flag.
699 Wed Nov 30 11:20:03 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
701 * conf-end.h: new file.
702 * config.h.bot: moved guts to conf-end.h.
704 * emacs.c(struct x_ftab): changed type of xf_db_char from char to int.
705 * emacs.c(x_emacs): changed type of c from char to int.
706 * emacs.c(X_NTAB): new define.
707 * emacs.c(x_bind,x_init_eamcs): new X_NTAB, X_TABSZ.
708 * emacs.c(x_prefix3, x_meta3): ifdef OS2.
709 * emacs.c(x_bind): ifdef OS2; mask *a1 with CHARMASK.
711 * exec.c(search_access): new function.
712 * exec.c(search): use search_access() instead of duplicating test.
713 * exec.c(search,search_access1): ifdef OS2.
715 * Makefile.in(OS2FILES): new macro.
716 * Makefile.in(dist): add OS2FILES to distribution.
718 * options.h(DEFAULT_PATH): ifdef OS2.
719 * edit.c(x_getc,x_mode): ifdef OS2.
720 * path.c(make_path): ifdef OS2.
722 Tue Nov 29 16:51:35 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
724 * sh.h(EXECSHELL,EXECSHELL_STR): ifdef OS2.
725 * exec.c(scriptexec): use EXECSHELL_STR (was "EXECSHELL").
727 * trap.c(sigtraps[]): ifdef OS2.
728 * lex.c(yylex): ifdef OS2.
729 * misc.c(change_flag): ifdef OS2.
730 * history.c(HISTFILE): ifdef OS2.
731 * eval.c(homedir): ifdef OS2.
732 * c_sh.c(shbuiltins[]): ifdef OS2.
734 * sh.h(ksh_execve,ksh_dupbase): new defines.
736 * jobs.c(exchild): ifdef use of nice.
738 Tue Nov 29 12:32:26 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
740 * eval.c(globit,copy_non_glob): changed to pass/use &xp it can change
741 (memory can be re-allocated).
743 * ksh_dir.h(NLENGTH): new macro.
744 * eval.c(globit): use NLENGTH macro.
746 * alloc.c(aresize): removed redundent np and optr variables.
748 Mon Nov 28 14:55:49 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
750 * config.h.bot(HISTORY): new define.
751 * lex.c(getsc_): ifdef HISTORY.
752 * history.c: ifdef HISTORY (dummy histsave, init_histvec and
753 hist_finish routines).
754 * c_ksh.c(kshbuiltins): c_fc: ifdef KSH
755 * lex.h(HISTORY): changed to HISTORYSIZE; changed all references.
757 * options.h(KSH): new define.
758 * config.h.bot: changed to deal with KSH define.
759 * exec.c(do_select,pr_menu): ifdef KSH.
760 * exec.c(execute): case TSELECT: ifdef KSH.
761 * c_ksh.c(c_whence,c_command,kshbuiltins[]): ifdef KSH.
762 * main.c(initcoms[],main): ifdef some aliases, SECONDS/RANDOM/TMOUT.
763 * syn.c(get_command): case TDBRACKET: ifdef KSH.
764 * syn.c(db_parse,db_aoexpr,db_nexpr,dp_primary): ifdef KSH.
765 * syn.c(tokentab[]): "select", "[[" ifdef KSH.
766 * var.c(special,getspec,setspec,unsetspec): ifdef KSH.
767 * ksh.1: ifdef KSH; misc fixups.
768 (changes mostly from Michael Haardt).
770 Mon Nov 28 14:27:34 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
772 * var.c(skip_varname,special,global,local), table.c(hash,tsearch,
773 tenter): made argument and return value const.
775 * main.c(version_param[]): new variable.
776 * main.c(initcoms[],main): use version_param instead of "KSH_VERSION".
778 * history.c(histsave): EASY_HISTORY: changed to take same arguments
779 as COMPLEX_HISTORY histsave(); changed all calls, removing
782 * vi.c(x_vi), emacs.c(x_emacs): changed unwind() call from LINTR
783 to LSHELL so newline isn't printed twice - also lets runtrap()
786 * vi.c(vi_cmd): increment source line if saving to history.
788 Fri Nov 25 14:43:57 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
790 * syn.c(get_command): don't generate a syntax error if EOF is read.
792 * configure.in: add LDSTATIC to LDFALGS if the former is set.
794 * history.c(hist_skip_back): start at the end of the buffer, not
795 one past the end (fix from Simon J. Gerraty).
797 Thu Nov 24 09:53:49 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
799 * syn.c(get_command,dogroup): allow { ...;} to be used instead
800 of do ...;done in for/select loops.
802 Wed Nov 23 09:09:43 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
804 * made pdksh-5.1.0 distribution
806 * var.c(setspec): set seconds to current time - assigned value,
807 not just current time.
809 * emacs.c(x_copy_arg): deleted ifdef'd out code (x_prev_histword()
810 does what it was supposed to do).
812 * emacs.c(compl_command): don't call list_stash() twice (happened
813 if type == 2 and multi set).
815 Tue Nov 22 10:26:13 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
817 * c_test.c(eval_unop): don't assume S_ISBLK, S_ISCHR, S_ISUID,
820 * path.c(make_path): avoid addeding extra /'s in paths; avoid
821 infinate loop if result buffer not big enough.
823 * main.c(main): setting PWD: avoid calling setstr() with the
824 current value of PWD.
826 * var.c(typeset): set free_me to 0 if t is integer.
828 * emacs.c(x_search_hist): added overflow checking to fixed sized
830 * emacs.c(compl_file,compl_command): removed fixed sized buffers.
832 * vi.c(x_vi), emacs.c(x_emacs): on interrupt, unwind instead of
835 * vi.c(vi_cmd): added 'g' command to goto the most recent command.
837 * c_sh.c(c_read), c_ksh.c(c_print): always increment source->line when
840 Mon Nov 21 10:45:34 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
842 * exec.c(do_selectargs): removed use of pmenu variable (redundent)
843 use isspace() instead of IFS chars; include <ctype.h>.
845 * aclocal.m4(KSH_TERM_CHECK): do not allow HAVE_TERMIOS_H check to
846 succeed on ultrix (avoid type-ahead loss).
848 * emacs.c(x_fword): cahnged loop to skip non word chars, then word
849 chars (was the opposite).
851 * main.c(shell): after error/interrupt/etc, reset an EOF if ignoreeof
854 * vi.c(classify[]): changed space (040) from C_|U_ to M_
855 (got broken in 5.0.10).
857 * ksh_wait.h(ksh_waitpid): new define.
858 * jobs.c(waitpid): moved define to ksh_wait.h; changed use of
859 waitpid() to ksh_waitpid().
861 * history.c(hist_skip_back),io.c(maketemp): use procpid instead of
864 Fri Nov 18 16:08:09 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
866 * vi.c(FSHOW8): inverted meaning: now if set, do the M- stuff
867 (done so 8 bit char sets work by default).
869 * main.c(main): set exstat to 127 if command file can't be opened.
871 * main.c(main): use argv[0] instead of kshname when deciding
872 whether to include profiles.
874 Fri Nov 18 14:25:11 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
876 * made pdksh-5.0.10.1 distribution
878 * tty.h: deleted KSH_VDISABLE; moved _POSIX_VDISABLE stuff to edit.c.
879 * edit.c(x_init): calculate value for vdisable_c.
880 * edit.c(x_mode): use vdisable_c instead of KSH_VDISABLE.
882 Thu Nov 17 12:09:13 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
884 * made pdksh-5.0.10 distribution
886 * lex.c(getsc_),edit.c(x_getc): call runtraps(FALSE) if read is
888 * vi.c(x_vi),emacs.c(x_emacs): call runtraps(FALSE) (was TRUE).
890 Wed Nov 16 09:48:54 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
892 * exec.c(execute,scriptexec): call __setostype(0)/(1) before/after
893 execve() on ISC machines.
895 * trap.c(trap_pending): new fuction.
896 * jobs.c(j_waitj): use trap_pending(); return -<signal-number> if
898 * jobs.c(waitfor): added sigp argument; changed all calls.
899 * c_sh.c(c_wait): use signal number set by waitfor() to set exit status.
901 * shf.c(SHF_INTERRUPT): no longer calls intrcheck() - now sets
902 error flag and returns EOF.
903 * c_sh.c(c_read): re-arranged to have single shf_getc() call; if read
904 interrupted and signal is fatal (fatal_trap_check()), make read
905 return with appropriate exit code.
906 * trap.c(fatal_trap_check()): new function.
907 * trap.c(inittraps()): catch and cleanup on SIGHUP; don't force the
908 setting of SIGINT,SIGQUIT,SIGTERM,SIGHUP.
910 * table.c(tenter): changed to use strlen()/memcpy() instead of loops.
912 * var.c(initvar): new function.
913 * main.c(main): call initvar().
914 * var.c(special): changed to use hash table for lookup.
916 * main.c(main),syn.c(initkeywords): moved table initialization
917 from main() to initkeywords().
919 Tue Nov 15 10:01:20 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
921 * eval.c(copy_non_glob): new routine.
922 * eval.c(globit): changed to use copy_non_glob() instead of strchr().
924 * misc.c(cclass): if [..] pattern has no closing ], do literal
925 compare of character with [ (used to always fail).
927 * eval.c(globit): handle symbolic links in the check code.
929 * configure.in: added check for lstat().
930 * ksh_stat.h: defined lstat to be stat if lstat is not available.
932 * exec.c(search): return Xclose() instead of Xstring().
934 Mon Nov 14 16:28:41 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
936 * ksh_times.h: changed BROKEN_TIMES to TIMES_BROKEN.
938 * c_test.c(syntax): removed \n from error messages.
940 * eval.c(glob,globit): changed to use dynamicly allocated string
941 instead of a fixed sized buffer.
943 Thu Nov 10 10:47:55 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
945 * history.c(sethistsize): don't set size if new size is < 0; fixed
946 offset calculation so histptr is not way beyond the end of array;
947 if history is shrinking, save newest history back.
949 * vi.c(vi_hook): case VSEARCH: call restore_cbuf() after \n or \r.
951 * main.c(quitenv): call restfd() even if fd < 0 to re-close fd.
953 * exec.c(execute): commented out code that set savefd[0/1] to -1
954 if input/output was a pipeline.
956 * missing.c(dup2_fixup): deleted function.
957 * sh.h(dup2->dup2_fixup): deleted define.
958 * io.c(ksh_dup2): new function; changed all dup2() calls to ksh_dup2().
960 Wed Nov 9 11:11:31 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
962 * edit.h(struct edchars): added eof field.
963 * edit.c(x_init): initialize eof fields.
964 * vi.c(x_vi): changed ^D to edchars.eof.
965 * vi.c(vi_cmd): make I/cc/S skip blanks.
967 * history.c(histsave): EASY_HISTORY: use memmove() to copy pointers
970 * vi.c(vi_cmd): make G act the same as at&t ksh.
971 * vi.c(ismeta,O_): deleted macros; removed all references to O_.
972 * vi.c(classify[]): add ^X and ^F to command mode.
974 Tue Nov 8 11:15:01 NST 1994 Michael Rendell (michael@arlene.cs.mun.ca)
976 * main.c(initsubs[]): don't set SHELL.
978 * vi.c(vi_cmd): added v command (start up vi).
979 * vi.c(vi_hook): added case for vi_cmd() returning 2.
980 * vi.c(grabsearch): set anchored flag if pattern starts with ^.
981 (based on fixes from Michael Jetzer).
983 * history.c(findhist): added anchored argument; changed all calls.
984 * history.c(histget): start searching from histptr-1; changed to
985 call findhist() to do searching.
986 * history.c(c_fc): changed to print multiline commands correctly.
987 (based on fixes from Michael Jetzer).
989 Fri Nov 4 10:30:14 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
991 * lex.c(yylex): when pushing alias sources, allocate from existing
994 * lex.c(struct source): added areap field.
995 * lex.c(pushs): added area argument; changed all calls.
996 * history.c(histrpl): changed constant sized hline[] to expandable
997 string; removed hline/hsize parameters; changed all calls; put
998 newline at end of string.
999 * history.c(c_fc): changed to use dynamically sized buffer when reading
1000 commands; strip nulls after read.
1001 * history.c(histbackup): made static.
1003 * trap.c(block_pipe): if handler is SIG_DFL, change it to SIG_IGN.
1005 * lex.c(readhere): changed to allow eof after end-of-file marker
1006 (bug report from Andrew Moore).
1008 Thu Nov 3 09:09:39 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
1010 * io.c(coproc_read_close,coproc_write_close): new functions.
1011 * c_sh.c(c_read): call coproc_read_close() when eof is read.
1012 * c_ksh.c(c_print): set PO_COPROC if fd is coproc.write; call
1013 coproc_write_close() if write fails due to EPIPE.
1014 * exec.c(iosetup): call coproc_write_close() after #>&p.
1015 * sh.h(EF_COPROC_DUPED): deleted.
1016 * sh.h(struct coproc): deleted isopen field.
1017 * io.c(cleanup_coproc): do not use isopen field.
1018 * c_sh.c(c_exec): deleted EF_COPROC_DUPED code.
1019 * exec.c(TCOPROC): don't set isopen; don't start new coprocess if
1020 old job exists and write pipe hasn't been closed.
1022 * misc.c(str_zcpy): new function.
1023 * lex.c(getsc_): made line[] buffer local/static; use str_zcpy()
1025 * history.c(c_fc): use local hline buffer instead of global line[];
1026 use str_zcpy() to fill hline[];
1027 * history.c(histrpl): added hline and hsize parameters; changed all
1029 * history.c(hist_init): EASY_HISTORY: use local hilne buffer instead
1031 * lex.h(line[]): deleted.
1032 * syn.c(compile): do not set s->str to null for STTY and SHIST.
1034 Wed Nov 2 11:48:36 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
1036 * lex.c(getsc_): case SDDPAREN: set csstate before going to
1039 * Makefile.in(RCSFILES): removed POSIX from list (now covered in
1042 Tue Nov 1 09:27:46 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
1044 * eval.c(comsub): save/restore source before/after compile().
1046 * c_ulimit.c(c_ulimit): allow value to be arithmetic expression
1049 * c_sh.c(c_read): call set_prompt() before printing prompt.
1051 * expr.c(v_evaluate): treat an empty expression as 0.
1053 Mon Oct 31 09:23:57 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
1055 * vi.c(grabhist,grabsearch): check that history line doesn't overflow
1058 * history.c(hist_finish): (EASY_HISTORY) changed for-loop condition to
1059 prevent passing the end of history.
1061 * eval.c(expand): when stuffing MAGIC, cast c to char.
1063 * misc.c(strip_nuls): new function.
1064 * lex.c(getsc_): case STTY/SFILE/SSTDIN: call strip_nuls() after
1067 * edit.c(set_editmode): reversed strstr() arguments - check for
1068 vi/emacs in $EDITOR/$VISUAL string.
1070 * syn.c(yyparse): allow EOF as well as newline after a command.
1071 * lex.c(getsc_): case SSTRING: don't fake newline
1073 Sun Oct 30 10:55:20 NST 1994 Michael Rendell (michael@panda.cs.mun.ca)
1075 * c_ksh.c(c_print): echo: check for -n, -e and -E options.
1077 * exec.c(comexec): don't allow command -p if restricted.
1079 Fri Oct 28 10:24:48 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
1081 * var.c(typeset): in fake_assign code, was freeing t->val.s + t->type
1082 instead of t->val.s - now uses free_me variable instead of aflag.
1084 * Makefile.in(depend): change blank lines in depend output to sh.h
1085 so dumb make(1)s won't die.
1087 * mail.c: changed checking to use atime/mtime instead of size; changed
1088 struct mbox mb_size field to mb_mtime, changed all references.
1090 * main.c(shell): do not execute (or set the exit status for) a null
1092 * lex.c(readhere): read the newline after the eof marker.
1094 Wed Oct 26 09:11:08 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
1096 * eval.c(globit): added FMARKDIRS support.
1098 * emacs.c(x_ftab[]): added entries for ansi arrow key bindings.
1100 * exec.c(execute,iosetup): move tracing of redirections from
1101 execute() to iosetup() so expanded name can be printed.
1103 * exec.c(execute): case TDBRACKET: read was being called instead of
1106 * ksh_stat.h(S_ISCDF): new define.
1107 * c_test.c: added -H for context dependent files (HP bizarreness).
1109 * main.c(initcoms[]): added alias local=typeset.
1111 * Makefile.in(stamp-h,config.status): added double quotes CONFIG_FILES
1112 and LDSTATIC assignments for dmake.
1113 * aclocal.m4(KSH_SYS_SIGLIST): do something with sys_siglist so it
1114 isn't optimized away.
1115 * aclocal.m4(KSH_CLOCK_T): do extra check for clock_t in sys/times.h.
1116 * acconfig.h(CLOCK_T_IN_SYS_TIMES_H): new define.
1117 * sh.h(SIGNALS): use _SIGMAX if NSIG, _MINIX not defined.
1118 (fixes from Brian Campbell <brianc@qnx.com>)
1120 * emacs.c(x_transpose): changed behavior if FGMACS flag set
1121 (fix from <guy@netapp.com>).
1123 Tue Oct 25 17:11:58 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
1125 * tty.c(KSH_VDISABLE): new define.
1126 * edit.c(x_init): use KSH_VDISABLE.
1128 Tue Oct 25 09:55:09 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
1130 * made pdksh-5.0.9 distribution
1132 * c_ulimit.c(c_ulimit): changed SOFT, HARD from enum to defines
1133 to avoid problems with ancient compilers.
1135 * vi.c(CHAR_LEN,char_len): changed macro to function; added FVISHOW8
1137 * misc.c(options[]), sh.h(FVISHOW8): added FVISHOW8 option.
1139 Sun Oct 23 11:02:26 NDT 1994 Michael Rendell (michael@maple.cs.mun.ca)
1141 * main.c(shell): keep unwinding if LINTR and not interactive.
1143 * lex.c(yylex): do redumentery quote parsing for $(..).
1145 Thu Oct 20 11:02:27 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
1147 * exec.c(execute): case TSELECT: set rv to 1 if eof is read.
1148 * exec.c(execute): case TFOR/TSELECT/TWHILE/TUNTIL: set rv to 0 before
1149 entering loop, but after setjmp incase of a continue; rv to 0
1151 * exec.c(execute): case TFOR/TSELECT: do readonly check before
1153 * c_ksh.c(c_getopts): do readonly check before assigning value.
1155 * misc.c(print_columns),c_ksh.c(kill_fmt_entry),
1156 misc.c(options_fmt_entry),exec.c(select_fmt_entry): new functions.
1157 * c_ksh.c(c_kill),misc.c(printoptions),exec.c(pr_menu): use
1158 print_columns() call a call-back routine to format information
1161 Wed Oct 19 10:26:25 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1163 * misc.c(cclass): require MAGIC before - and ].
1164 * eval.c(expand): prefix - and ] with MAGIC if appropriate.
1166 * var.c(typeset): don't allow export flag of readonly variables
1169 * eval.c(globit): added call to intrcheck().
1171 Mon Oct 17 11:48:05 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1173 * lex.c(readhere): check for and report write errors.
1175 Sun Oct 16 16:10:59 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1177 * c_ksh.c(c_cd): don't allow cd if restricted.
1178 * exec.c(comexec): if restricted and command contains /, print error.
1179 * exec.c(ioestup): if restricted, don't allow file creations.
1180 * main.c(is_restricted): new function.
1181 * main.c(main): save and reset FRESTRICTED during .profile/ENV reading;
1182 set FRESTRICTED if argv[0] or SHELL refers to restricted shell;
1183 make PATH, ENV, SHELL readonly if restricted.
1184 * var.c(typeset): check for restricted shell and PATH/ENV/SHELL.
1186 Thu Oct 13 21:01:14 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
1188 * main.c(shell): only call j_notify() for interactive shells.
1190 * c_sh.c(c_read): check if variable is readonly before assigning
1193 Wed Oct 12 14:08:46 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
1195 * lex.h(COPROC),tree.h(TCOPROC,XCOPROC): added defines.
1196 * lex.c(yylex): return COPROC for |& token.
1197 * syn.c(tokentab): added COPROC.
1198 * syn.c(c_list): accept COPROC, create TCOPROC node.
1199 * tree.c(ptree): added case for TCOPROC.
1200 * exec.c(execute): added case for TCOPROC.
1201 * io.c(check_fd,get_coproc_fd): new functions.
1202 * c_sh.c(c_read),c_ksh.c(c_print): changed to use check_fd();
1203 added -p option; for c_print() ensure SIGPIPE doesn't kill shell.
1204 * exec.c(iosetup): changed to use check_fd() for IODUP; when
1205 checking fore close, require exactly the string '-', not any
1206 string starting with '-'; added strerror() to error message.
1207 * jobs.c(exchild): don't open /dev/null if XCOPROC; close
1208 coproc.read/write/childread in child if XCOPROC; don't pass
1209 XCOPROC flag on to execute(); set coproc.job to job in parent
1211 * jobs.c(check_job): clear coproc.job if said job dies.
1212 * trap.c(block_pipe,restore_pipe): new functions.
1213 * sh.h(struct coproc, EF_COPROC_DUPED): new structure and define.
1214 * c_sh.c(c_exec): if EF_COPROC_DUPED set, clean up co-process stuff.
1216 * main.c(cleanup_parents_env): new function.
1217 * jobs.c(exchild): call cleanup_parents_env() after fork().
1219 * tree.h(IORDUP): new define.
1220 * lex.c(yylex): changed redirection parsing to not accept & only after
1221 a single < or >; set IORDUP flag for x<&y; fixed <</<>/>> check to
1222 not allow >< (again).
1223 * tree.c(pioact): use IORDUP flag to print <& or >&.
1225 * jobs.c(exchild): set JF_ORIGFG flag if job started in foreground.
1226 * jobs.c(j_waitj): don't get default tty settings if JF_ORIGFG not
1229 * misc.c(parse_args): treat -A as a flag that is handled later
1230 (used to require argument); do array setting after argument
1232 * var.c(set_array): changed second argument from 0/1 flag to
1233 -1/1 flag; changed all calls.
1235 Thu Oct 6 11:55:27 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1237 * table.c(tinit): added initial table size argument; call texpand
1238 if size isn't 0; changed all calls.
1239 * main.c(main): try to make sure table size is big enough for
1240 builtins and keywords (cut down on amount of re-hashing).
1242 * eval.c(expand): added next and prev fields to struct SubType;
1243 removed fixed length subtype array, changed code to allocate
1246 Wed Oct 5 09:25:06 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1248 * main.c(main): moved initio() above inittraps() as later can print
1251 * table.h(IMPORT): new flag.
1252 * var.c(typeset): if IMPORT flag set, don't allow array references,
1253 insist on assignment.
1254 * var.c(import): deleted function.
1255 * main.c(main): use typeset() instead of import().
1257 * sh.h: include expand.h.
1258 * expand.h(Xnleft): new define.
1259 * expand.h(struct XString, Xinit): added areap field; added area
1260 argument to Xinit; changed all calls.
1261 * lex.h(struct source): added xs field.
1262 * shf.c(shf_gets,shf_getse): changed name fromshf_gets to shf_getse;
1263 return pointer to null byte instead of start of buffer.
1264 * lex.c(pushs): if type is SFILE or SSTDIN, initialize s->xs.
1265 * lex.c(getsc_): case SFILE/SSTDIN: use s->xs instead of fixed
1268 * syn.c(compile): don't change s->str if SFILE.
1269 * main.c(main): call pushs() explicitly for each of SSTRING,
1270 SFILE, SSTDIN, STTY.
1272 * aclocal.m4(KSH_GCC_FUNC_ATTR): changed GCC_FUNC_ATTR to
1274 * config.h.bot: changed use of GCC_FUNC_ATTR; deleted
1275 GCC_FA_NORETURN, GCC_FA_CONST, GCC_FA_FORMAT defines, created
1276 generic GCC_FUNC_ATTR define; changed all uses of GCC_FA_*.
1278 * main.c(main): set s->file for SSTDIN input.
1280 * main.c(shell): pass LERROR on if not interactive.
1282 * expand.h(Xcheck,XcheckN): added XcheckN define, changed Xcheck
1283 to use XcheckN; made XcheckN call Xcheck_grow_() do do any real work
1284 (to cut down on code size).
1285 * misc.c(Xcheck_grow_): new function.
1286 * exec.c(search),c_sh.c(c_read): changed to use Xstring() routines
1287 (used to use the fixed size buffer line[]).
1288 * exec.c(findcom): avoid re-saving search() result in ATEMP.
1290 Tue Oct 4 15:32:37 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1292 * jobs.c(j_jobs): return int value indicating error/ok; changed
1295 * misc.c(getn): added int * argument to hold result; changed
1296 return value to indicate success/failure; changed all calls.
1297 * misc.c(bi_getn): new function.
1298 * misc.c(getn_): deleted function.
1300 * io.c(internal_error,error_prefix,warningf): new functions.
1301 * *.c: changed errorf() calls reporting internal errors to
1302 use internal_error() function; changed many shellf()s to
1304 * io.c(errorf),lex.c(yyerror): changed to use error_prefix().
1306 * alloc.c(aprint): ifdef'd out.
1307 * tree.c(phash): deleted function.
1309 Mon Oct 3 15:08:24 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1311 * sh.h(kshname): new variable
1312 * main.c(main): changed name to kshname, deleted local variable.
1313 * exec.c(comsub): update kshname.
1314 * var.c(popblock): restore kshname.
1315 * io.c(errorf,bi_errorf): print shell name before error message.
1317 * c_ksh.c(c_cd): print new directory on stdout, not stderr.
1319 * sh.h(GI_MINUS): new define.
1320 * misc.c(ksh_getopts): changed so once - or + introduces option,
1321 all options must start with same character.
1323 * sh.h(builtin_argv0): new variable.
1324 * exec.c(call_builtin): set/clear builtin_argv0, builtin_flag; changed
1325 argument to a struct tbl *; changed all calls.
1326 * io.c(bi_errorf): new function.
1327 * c_ksh.c,c_sh.c,c_ulimit.c,emacs.c,history.c,jobs.c: changed all uses
1328 of errorf() to bi_errorf().
1329 * emacs.c(x_bind): changed return value to int; changed all calls.
1330 * history.c(histrpl): return 0 if there is an error; changed all calls.
1331 * misc.c(parse_args): use bi_errorf(); return -1 for error; changed all
1333 * misc.c(ksh_getopts): call bi_errorf instead of errorf which means
1334 ksh_getopts() may return after an error, so changed all calls to
1335 check for '?' return.
1337 * exec.c(iosetup): use shellf() to report errors and return value
1338 indicating success or failure.
1339 * exec.c(execute): if iosetup fails, cause fatal error for special
1340 builtins, return otherwise; print PS4 and redirections.
1342 Fri Sep 30 15:17:37 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1344 * c_ulimit.c(c_ulimit): accept unlimited as a valid value.
1346 * c_test.c(c_test): changed posix special case code to use
1349 * c_ksh.c(c_whence): for whence -p, don't look for built-ins or
1352 Thu Sep 29 10:34:59 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1354 * c_ksh.c(c_alias): added -r option so the sysv-bounre shell
1357 * eval.c(debunk): use strchr() to find first MAGIC, if any.
1359 Wed Sep 28 15:34:32 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1361 * sh.h(O_NONBLOCK): define to O_NDELAY or FNDELAY if not defined.
1362 * main.c(main): if stdin is O_NONBLOCK'd, clear O_NONBLOCK.
1364 * misc.c(options[], parse_args): make -c a normal flag, not an option
1365 with an argument (POSIX); deleted cargp argument to parse_args().
1366 * main.c(main): print error if -c and no arguments left.
1368 * lex.h(SSTDIN): new define.
1369 * lex.c(yylex): added case for SSTDIN.
1370 * main.c(main): if -s flag used, set source type to SSTDIN.
1372 Tue Sep 27 08:52:11 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1374 * lex.c(get_brace_var): new function.
1375 * lex.c(yylex): removed most ${..} parsing - leave it to expand();
1376 use get_brace_var() to read the variable part of a ${..} expression.
1377 * tree.c(tputs,wdscan): case OSUBST: delete code that understood
1378 partially compiled ${..}.
1379 * sh.h(C_SUBOP,C_SUBOP1,C_SUBOP2): changed C_SUBOP to C_SUBOP1,
1381 * misc.c(initctypes): removed # and % from C_SUBOP; changed C_SUBOP to
1382 C_SUBOP1; added C_SUBOP2.
1383 * eval.c(varsub): look at word part of substitution to figure out
1384 type of substitution; check for bad substitutions; check for unset
1385 variables for #/% substitutions.
1386 * eval.c(struct SubType): changed type field to stype; changed quote
1387 field to short; added f field.
1388 * tree.h(DOTEMP_): new define.
1389 * eval.c(expand): case CSUBST: case '=': deleted bad substitution
1390 error (now handled in varsub); case OSUBST: removed special handling
1391 of trimming - varsub() does it now; when pushing/poping state (st),
1392 save/restore value of f; set f to DOPAT when trimming; case CSUBST:
1393 case '=': restore original position in string, substitute the value
1394 of the variable (as opposed to the value that was assigned to the
1395 variable); case OSUBST: if '?' qualifier, turn off DOBLANK when
1396 expandined word part; define DOTEMP_ when expanding word part
1397 of ${..[#%=?]..}; deleted first_eq and tstart - replaced with
1398 tilde_ok and saw_eq.
1400 * eval.c(expand): tilde expansion: use tstart variable instead of cp;
1401 changed '?' error message to be like at&t ksh; don't test if strval()
1402 returns NULL - it doesn't.
1404 * var.c(strval): if !ISSET, instead of returning null, set s to null.
1406 * exec.c(comexec): case TDBRACKET: don't pass DOASNTILDE to evalstr().
1408 * exec.c(scriptexec): changed line[] to buf[] so it doesn't get
1409 confused with global the line[].
1411 * main.c(initsubs): initialize PS4.
1412 * edit.c(x_getc): cast char to unsigned before returning.
1414 Mon Sep 26 11:06:55 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1416 * eval.c(globit): call strnsave instead of strsave; if file has
1417 trailing /, use stat() to check that it is a directory.
1419 * eval.c(expand): case CSUBST: case #/%: deleted duplicate *dp = 0;
1420 case CSUBST: case =: copy string and call debunk() to oust MAGICs.
1422 * misc.c(print_value_quoted): deleted bogus shf_shlout argument to
1423 shprintf(); deleted unneeded test (p != s).
1425 * main.c(main): turn on FBRACEEXPAND.
1426 * misc.c(change_flag): turn FBRACEEXPAND off if turning FPOSIX on.
1428 * vi.c(x_vi): use x_vi_zotc() to print ^D.
1429 * vi.c(CHAR_LEN): new define.
1430 * vi.c(vi_hook): use CHAR_LEN() instead of inline tests for
1431 c < ' ' || c== 0x7f; search editing: display M- if necessary.
1432 * vi.c(display): changed to deal tiwh meta-characters.
1434 * vi.c(x_vi_zotc): print M- for meta chars.
1435 * emacs.c(x_e_getc): new function; changed all x_getc() calls to
1437 * edit.c(x_getc): don't and out upper bit.
1439 * sh.h(OPAREN,CPAREN,OBRACK,CBRACK,OBRACE,CBRACE): new defines
1440 * expr.c(OPAREN,CPAREN): re-named to OPEN_PAREN, CLOSE_PAREN.
1442 * eval.c(debunk): changed to convert MAGIC MAGIC -> MAGIC.
1443 * eval.c(expand): removed ismagic_bracket stuff - not needed.
1444 * eval.c(expand): always restore value of quote when CSUBST
1445 reached; don't set DOGLOB in fdo if trimming.
1447 Sat Sep 24 11:46:03 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1449 * tree.h(DOBRACE_): new define.
1450 * eval.c(expand): changed check for leading ! in [..] to be more
1451 robust (old test could have looked before start of string).
1452 * eval.c(expand,maybe_expand_tilde): case ~: moved code into a function
1453 (maybe_expand_tilde).
1454 * eval.c(expand): expand alternations after macros, before globing
1455 (was before macros).
1456 * eval.c(alt_expand): changed to be called after macro expansion.
1457 * eval.c(alt_scan,alt_count): deleted (no longer needed).
1459 * misc.c(cclass): return NULL (no match) if first char in a range
1460 is greater than the second.
1461 * eval.c(expand): when building strings, stuff literal MAGIC chars.
1463 Thu Sep 22 15:05:48 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
1465 * exec.c(comexec): re-arranged handling of builtin and exec;
1466 handle command (and command -p, etc.); deleted comexec_flags
1467 variable; made function static again; removed fcflags argument.
1468 * table.h(FC_NOBLOCK): deleted define.
1469 * c_sh.c(c_exec): changed empty function to deal with preserving I/O
1470 redirects (code taken from comexec()).
1471 * c_ksh.c(c_command): new function - calls c_whence.
1472 * c_ksh.c(c_whence): removed code to deal with command -p.
1474 * Makefile.in: changed [ to test.
1475 * shf.h: changed errno structure member to errno_; changed all uses
1476 (fixes for QNX from Brian Campbell).
1478 * c_test.c(enum Op): deleted trailing comma (some compilers complain).
1479 * proto.h: added volatile to tp arg of comexec() prototype.
1481 Thu Sep 22 11:08:31 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
1483 * made pdksh-5.0.8 distribution
1485 * Makefile.in(install): added missing dollar (fix from Thomas Gellekum).
1487 * emacs.c: changed CMASK to CHARMASK to avoid conflicts with some
1488 system headers (eg, HP-UX 9.01 <sys/param.h>). Reported by Sean
1491 * history.c(c_fc): wp not being incremented; -e strcmp() test reversed
1492 (reported by Sean Hogan).
1494 Thu Sep 21 21:12:03 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
1496 * made pdksh-5.0.7 distribution
1498 Tue Sep 20 09:56:54 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1500 * history.c(c_fc): use ksh_getopt() to parse arguments.
1501 * c_ksh.c(c_bind): use ksh_getopt() to parse arguments.
1503 * main.c(initcoms[]): changed hash alias from alias -t - to alias -t --.
1505 * misc.c(print_value_quoted): don't use quotes if no special
1508 * c_ksh.c(c_whence): added POSIX command command.
1510 * c_sh.c(c_label): removed check for null wp.
1512 * exec.c(comexec): added new flags argument (FC_*);
1513 don't call newblock() if FC_NOBLOCK set; pass flags on to
1514 findcom(); changed all calls; made comexc() a non-static
1517 * table.h:(FC_SPECBI,FC_FUNC,FC_REGBI,FC_UNREGBI,FC_PATH,FC_DEFPATH,
1518 FC_NOAUTOLOAD,FC_NOBLOCK): new defines.
1519 * exec.c(findcom): merged insert/justsearch/autoload arguments
1520 into one flags argument; changed code to check various flags;
1523 Sat Sep 17 20:17:59 NDT 1994 Michael Rendell (michael@garfield.cs.mun.ca)
1525 * exec.c(comexec): print error if builtin has no command.
1527 * exec.c(execute): before doing redirections, check for TCOM and
1528 evaluate arguments and determine if it is a special builtin;
1529 print arguments (using PS4) if FXTRACE set; case TCOM: simply call
1531 * exec.c(comexec): deleted vp argument; only call newblock() if
1532 needed (ie, !special, !empty); evaluate assignments and put
1533 in environment one at a time; print environment (using PS4) if
1534 FXTRACE set; removed code to turn empty command into :;
1535 removed environment setting code in switch statement.
1536 * exec.c(echo): deleted function.
1538 * lex.c(yylex): only honour CMDWORD if FPOSIX set.
1540 * c_sh.c(shbuiltins): removed = attribute from false/true commands.
1542 * sh.h(E_TCOM): delete define - not used.
1544 * sh.h(null),var.c: use EXTERN for initialization of null.
1545 * sh.h(space,newline,slash): new variables (" ", "\n", "/")
1546 use these everwhere instead of "", " ", "\n", "/".
1547 * path.c: include sh.h.
1549 * exec.c(execute): combined TFOR/TSELECT cases.
1551 Fri Sep 16 11:32:01 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
1553 * lex.h(CMDWORD): new define to prevent continued alias expansion in
1554 non-command contexts.
1555 * lex.c(yylex): only set ALIAS if SF_ALIAS and CMDWORD are set.
1556 * syn.c(get_command): case LWORD/REDIR: pass CMDWORD if argc is 0.
1558 * exec.c(comexec): if there is no command, do assignments and set
1559 the return value to subst_exstat (used to fake a : command).
1561 * sh.h(subst_exstat): new variable.
1562 * exec.c(execute): case TCOM: clear subst_exstat before doing eval()s.
1563 * eval.c(expand): set subst_exstat to return value of waitlast().
1564 * c_sh.c(c_set): if !FPOSIX, return subst_exstat instead of 0.
1566 * exec.c(execute): removed redundent "exstat = rv;" near if FERREXIT.
1567 * exec.c(comexec): case CFUNC: for normal function completion, set
1568 i to 0 and rv to return value of execute() (was i=LRETURN,exstat=..).
1570 * main.c(include): return -1 if file could not be found/opened,
1571 otherwise, the exit status of the last command is returned;
1573 * c_sh.c(c_dot): print error if include() returns < 0.
1575 * var.c(setspec): ifdef EDIT'd V_VISUAL, V_EDITOR cases.
1577 * misc.c(parse_args): no longer accept set -o alternations as
1578 a substitute for set -o braceexpand.
1580 * jobs.c(j_exit): when restoring tty process group, also restore
1583 * config.h.bot: define JOB_SIGS iff we have modern signal and wait
1585 * jobs.c: use ifdef JOB_SIGS instead of ifdef JOBS when setting
1586 signal masks and routines or using waitpid; define TTY_PGRP and
1587 NEED_PGRP_SYNC separately from JOBS.
1588 * jobs.c(j_kill): only send SIGCONT if job is stopped.
1589 * jobs.c(j_jobs): remove exited/signaled jobs even if !FMONITOR,
1592 * jobs.c(check_job): ifdef FNOTIFY with JOBS (noted by
1593 Michael Haardt <u31b3hs@POOL.Informatik.RWTH-Aachen.DE>).
1594 * jobs.c(j_notify,j_waitj): put ifdef JOBS around use of FMONITOR.
1595 * main.c(shell): removed ifdef JOBS from declaration of interactive.
1597 * ksh_limval.h,sh.h: moved include of <limits.h> from ksh_limval.h
1598 to sh.h since some machines define CLK_TCK there.
1600 Thu Sep 15 09:58:14 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
1602 * vi.c(vi_cmd): took out ESC as file completion char in command mode
1605 * jobs.c(exchild): if starting a job in the background and FBGNICE
1606 is set, call nice().
1608 * Makefile.in: changed maxext to manext (fix from Thomas Gellekum
1609 <thomas@ghpc8.ihf.rwth-aachen.de>); in the install target, check
1610 if the path of the installed shell is in /etc/shells and
1611 complain if it isn't; added depend target, removed old $(OBJS)
1612 and trap.o dependencies.
1614 Wed Sep 14 09:39:55 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
1616 * misc.c(options[]): changed position of vi-tabcomplete option.
1618 * lex.c(yylex): ifdef use of FVI/FEMACS/FGMACES with VI/EMACS
1619 (fix from Gordan Larson <hoh@approve.se>).
1621 * ksh.1(DESCRIPTION): added missing P in \fP
1622 (fix from Gordan Larson <hoh@approve.se>).
1624 Tue Sep 13 11:01:47 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
1626 * made pdksh-5.0.6 distribution
1628 Mon Sep 12 11:39:07 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
1630 * exec.c(scriptexec): changed so it will compile if SHARPBANG is
1631 defined; fixed error message; shell argument is everything up to
1632 a newline; don't listen to #! line unless it ends in a newline.
1634 * syn.c(get_command): case FOR: changed VARASN to ARRAYVAR.
1636 * jobs.c(waitfor): restore signal mask before returning if named job
1637 isn't own own; when waiting for unspecified jobs, only consider
1638 running jobs; don't pass JW_STOPPEDWAIT flag to j_wait.
1640 * table.h(V_TMPDIR,tmpdir): new define/variable.
1641 * var.c(setspec, unsetspec): added case for V_TMPDIR.
1642 * io.c(maketemp): use tmpdir variable if it is set, else use /tmp.
1644 * var.c(popblock): if poping a variable that wasn't set in the old
1645 environment, call unsetspec().
1647 Fri Sep 9 10:37:18 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
1649 * sh.h(PATHMAX): increased value from 256 to 1024.
1651 * main.c(main): moved initialization of name to start of main;
1652 if getcwd() fails, use name in error message and call shf_flush().
1654 * io.c(maketemp): check/use TMPDIR variable instead of /tmp; allocate
1655 temp structure and path in one chunk.
1657 * c_ksh.c(c_cd): when checking for no home directory, compare
1658 against null, not (char *) 0.
1660 Thu Sep 8 10:52:59 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
1662 * lex.c(yylex): case SHIST: flush shl_out after printing command.
1664 * jobs.c(check_job): when notifing, do not remove job if it is stopped.
1666 Wed Sep 7 10:55:35 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
1668 * made pdksh-5.0.5 distribution
1670 * main.c(shell): commented out shf_flush(shl_out) - shouldn't be
1671 needed since -v flushes itself.
1673 Tue Sep 6 09:30:57 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1675 * sh.h(LSHELL,really_exit): new define/variable.
1676 * c_sh.c(c_exitreturn): if how is LEXIT, check if there are stopped
1677 jobs and, if so, unwind with LSHELL (also check/set really_exit).
1678 * main.c(shell): added case for LSHELL - stop unwinding if shell
1679 is interactive; changed local reallyquit to global really_exit.
1680 * main.c(include),exec.c(comexec): added case for LSHELL.
1682 * c_sh.c(c_exitreturn): quitenv() for LRETURN as well as LEXIT.
1684 * sh.h(TF_CHANGED): new define.
1685 * trap.c(runtrap): default EXIT/ERR trap during execution and restore
1686 original if TF_CHANGED not set.
1687 * trap.c(settrap): set TF_CHANGED when setting trap.
1689 * jobs.c(j_stopped): check that job created by current process; print
1690 "You have stopped jobs" message.
1691 * main.c(shell): don't print you have stopped jobs message.
1693 * main.c(initcoms): removed echo alias.
1694 * c_ksh.c(kshbuiltins): added echo as a builtin.
1695 * c_ksh.c(c_print): if wp[0] is echo, act like strict sysv echo;
1696 added \a (BEL) escape sequence.
1698 * syn.c(function_body): new function; calls get_command() to get
1699 the body of a function (old code did nested { } block which
1700 caused problems with how redirections after the block were
1702 * syn.c(get_command): call function body to deal with foo() and
1705 * jobs.c(restore_ttypgrp): new variable.
1706 * jobs.c(j_change): set restore_ttypgrp if process group is set.
1707 * jobs.c(j_exit): if necessary, restore tty process group for main
1710 Fri Sep 2 21:32:03 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1712 * main.c(main): set FPRIVILEGED if uid (gid) doesn't match euid (egid);
1713 don't include $HOME/.profile if FPRIVILEGED; include
1714 /etc/suid_profile instead of $ENV if FPRIVILEGED.
1715 * misc.c(change_flag): if clearing FPRIVILEGED flag, set euid (egid)
1718 Fri Sep 2 21:10:23 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1720 * main.c(main): don't include $ENV if uid (gid) doesn't match
1721 euid (egid) (from J.T.Conklin).
1723 Fri Sep 2 12:07:14 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1725 * syn.c(get_command): removed MPAREN case, taken care of in '(' case,
1726 as per POSIX.2 which says () is two operators, not one.
1727 * lex.c(yylex): don't check for/return MPAREN.
1728 * lex.h(MPAREN): deleted define.
1730 * configure.in: add test for library routine confstr(); add
1731 header test for paths.h.
1732 * sh.h: include paths.h if available; define DEFAULT__PATH.
1733 * table.h(def_path): new variable.
1734 * options.h(DEFAULT_PATH): new define.
1735 * main.c(main): initialize value of def_path; set path to def_path;
1736 remove PATH initalization from initsubs; do not set value of HOME
1737 variable (POSIX); allow SHELL, PS1, PS2, PS3 to have empty values
1739 * var.c(unsetspec): when unsetting PATH, set path to def_path.
1741 * jobs.c(j_waitj): restore proc mask before calling error if
1742 1st tcsetpgrp() fails.
1744 Thu Sep 1 10:28:03 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1746 * Makefile.in: added check-sig.c, check-fd.c and check-pgrp.c
1747 to RCSFILES; added rules for compiling the above; added debugtools
1748 target to compile them all.
1750 * c_test.c(arg0,t_error,T_ERR_EXIT): new variables/defines.
1751 * c_test.c(c_test): set arg0 to wp[0], t_error to 0; after
1752 calling eval_binop() or oexpr() check t_error and if set,
1754 * c_test.c(syntax): set t_error exit; use shellf() instead of
1755 errorf(); use arg0 instead of "test"; delete GCC_FA_NORETURN
1756 attribute; changed all calls to return after calling.
1757 * c_test.c(oexpr,aexpr,primary): check terror after calling
1758 oexpr(), aexpr(), nexpr().
1760 * c_test.c(primary): if unary operator is -t and there is no
1761 argument, don't increment t_wp; if missing closing parenthesis,
1762 show next operand (if any) in error message.
1763 * c_test.c(eval_unop): default case, print t_wp[-2] (was -1).
1764 * c_test.c(c_test): set t_wp before calling eval_binop() incase
1766 * c_test.c(syntax): print first message even if op is an empty string.
1768 Wed Aug 31 11:48:51 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1770 * expr.c(O_LT, O_GT): reverse order of enums to match opinfo table.
1772 * c_test.c(nexpr): always call !nexpr() (never !primary()).
1773 * c_test.c(c_test): switch on argc-1 to make code match POSIX
1774 description; make 4 arg case fall into 3 arg case, and 3 arg case
1775 fall into 2 arg case.
1776 * c_test.c(is_not,is_and,is_or): new defines.
1777 * c_test.c(c_test,oexpr,aexpr,nexpr): use is_not,is_and and is_or.
1778 * c_test.c(primary): don't decrement t_wp in final string case.
1780 * c_test.c(eval_unop): change S_ISIFO to S_ISFIFO and S_ISFITO
1783 * misc.c(parse_args): use OF_SET when initializing set_opts.
1785 Wed Aug 31 09:32:39 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1787 * made pdksh-5.0.4 distribution
1789 * jobs.c(j_change): do not restore tty process group when turning
1790 off job control; no need to save original tty process group;
1791 deleted orig_ttypgrp variable. (fixes bug in which turning off
1792 job control causes an interactive shell to exit)
1794 Tue Aug 30 14:43:48 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
1796 * aclocal.m4(KSH_OPENDIR_CHECK): always include sys/types.h;
1797 set return value according to what failed.
1799 Tue Aug 30 11:17:09 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1801 * missing.c(strerror): for systems without sys_errlist[], report
1802 error number if unknown.
1804 * Makefile.in: added BUG-REPORTS to DISTFILES.
1806 * jobs.c(exchild): do tcsetpgrp() in both parent and child after
1807 the first process is created (may need to change to every child).
1809 * aclocal.m4(KSH_PGRP_SYNC): new test - defines NEED_PGRP_SYNC.
1810 * acconfig.h: added define for NEED_PGRP_SYNC.
1811 * configure.in: use KSH_PGRP_SYNC test.
1812 * jobs.c(exchild,j_startjob,j_sync_open,j_sync_pipe): if NEED_PGRP_SYNC
1813 is defined, use a pipe to block the first process in a pipeline
1814 until the whole pipeline is set up.
1816 Mon Aug 29 09:15:00 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1818 * jobs.c(exchild): for background, unmonitored jobs, don't open
1819 /dev/null if input is a pipe.
1821 * jobs.c(exchild): for background, unmonitored jobs, use setsig()
1822 instead of setexecsig() to set up SIGQUIT and SIGINT; changed
1823 restoration of SIGTSTP,SIGTTIN,SIGTTOU - set them to DFL if
1824 monitoring and not a `..` command, otherwise leave them alone.
1825 * jobs.c(j_init): only use SIGTSTP,SIGTTIN,SIGTTOU if talking
1826 or monitoring - if just talking leave signals ignored.
1827 * jobs.c(j_change): if going into job control, set TF_SHELL_USES
1828 flag for sigtraps[SIGTSTP,SIGTTIN,SIGTTOU]; if leaving job control
1829 ignore signals if interactive, else restore original signals.
1831 * table.h(SPEC_BI, REG_BI): new defines.
1832 * exec.c(builtin): check for * or + in front of builtin names and set
1833 SPEC_BI or REG_BI if found.
1834 * exec.c(findcom): search for special builtins first, then functions,
1835 then regular builtins, then PATH search.
1836 * c_sh.c(shbuiltins[]),c_ksh(kshbuiltins[]): add */+ in front of POSIX
1837 special/regular builtins; add = infront of unset;
1838 remove = from alias.
1839 * c_sh.c(c_label): set exit value according to name (for true/false).
1840 * c_sh.c(shbuiltins[]): add entries for true and false.
1841 * main.c(initcoms[]): deleted true/false aliases.
1843 * aclocal.m4(KSH_OPENDIR_CHECK): new test - see if opendir() will
1844 open non-directories.
1845 * configure.in,acconfig.h: added KSH_OPENDIR_CHECK.
1846 * missing.c,ksh_dir.h(ksh_opendir): new define/function.
1847 * eval.c(globit),emacs.c(compl_file): use ksh_opendir() instead of
1850 * main.c(include): save source filename since search() uses line[]
1851 for the filename and shell() trashes line[].
1853 * table.h(FINUSE,FDELETE) new defines.
1854 * exec.c(execute): case CFUNC: re-arranged code so normal return goes
1855 through setjmp() switch; use FDELETE/FINUSE flags to avoid problems
1856 with a function being undefined or redefined during its execution.
1857 * exec.c(define): if FINUSE is set, set FDELETED and find a new table
1860 Fri Aug 26 21:58:25 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
1862 * lex.c(getsc_): flush output after write when echoing.
1864 * Makefile.in(dist): after creating distrubution, use pathchk -p
1865 to check file names.
1867 Fri Aug 26 10:28:20 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1869 * made pdksh-5.0.3 distribution
1871 * expr.c(IS_ASSIGNOP): new define.
1872 * expr.c(evalexpr): use IS_ASSIGNOP (bug fix).
1874 * exec.c(execute): case TFOR,TSELECT: change e->type just
1875 before setjmp() to avoid problems with bad jmpbufs.
1877 * jobs.c(startlast): new function.
1878 * jobs.c(waitlast): print error if job not started.
1879 * eval.c(comsub): call startlast() after execute().
1880 * jobs.c(exchild,j_startjob,j_sync_pipe): when starting a pipeline
1881 use a pipe to ensure the first process doesn't die before
1882 the last process is started.
1884 * exec.c(execute): case TFUNC: set/clear FXTRACE according to
1885 tp->flag & TRACE, and restore old value when function completes.
1887 * c_test.c,exec.c,io.c,mail.c,vi.c: changed all uses of
1888 (x&S_IFMT) == S_IF* to the equivilent S_IS* (for ISC unix).
1889 * c_test.c(eval_unop): if system doesn't have symlinks or sockets
1890 (S_ISLNK,S_ISSOCK), return 0 (used to cause internal error).
1891 * ksh_stat.h(S_ISVTX): define if sys/stat.h doesn't.
1893 * sigaction.c(Signal,signal): ifdef'd Signal() and signal() out as
1894 they cause header file conflicts on some systems (eg, signal()
1895 in ISC unix); also ifdef'd out other routines not used by ksh
1896 (ie, sigdelset, sigfillset, sigismember, sigpending).
1898 Thu Aug 25 11:50:03 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1900 * c_test.c(primary): always check that *t_wp isn't 0 before using it.
1902 * eval.c(homedir): cache home directory values.
1904 * exec.c(findcom): search builtins before tracked aliases.
1906 * table.h(commands,taliases): changed name of commands to taliases.
1908 * c_ksh.c(c_unalias): changed to use ksh_getopt(); added -t and -a
1909 options; exit with non-zero value if non-alias name unaliased
1912 * main.c(initcoms[]): alias hash to 'alias -t -'; added autoload alias
1913 as well; set selected comands to be tracked aliases (eg, grep,
1914 ls, who, vi, emacs, etc.).
1916 * c_ksh.c(c_alias): when printing aliases, check ISSET, not DEFINED
1917 flag (so unset tracked aliases won't cause problems); changed
1918 to use ksh_getopt(); added -t flag; added -x flag (does nothing).
1919 * c_ksh.c(c_hash): deleted function; removed all references.
1921 * table.h(CTALIAS): new define.
1922 * exec.c(findcom): added search argument for whence -p; fixed
1923 introduced bug preventing tracking of commands when insert set;
1924 changed all calls; when creating tracked aliases, set type to CTALIAS
1926 * exec.c(findcom,flushcom): when freeing old tracked aliases, use
1927 APERM, not commands.areap.
1928 * c_ksh.c(c_whence): changed to use ksh_getopt(); assume findcom()
1929 never returns 0 and never returns tp->type == CNONE; made output
1930 closer to at&t ksh output; combined vflag/!vflag switch statements;
1931 added case for CTALIAS.
1932 * exec.c(findcom): set tracked alias type to CTALIAS.
1934 * c_ksh.c(c_print): added -s option; changed to use Xstring() routines
1935 and write() instead of shf routines; returns non-zero if there
1938 * jobs.c(struct job): changed pid_t lpid field to Proc *last_proc;
1940 * jobs.c(check_job): use j->last_proc instead of lp.
1941 * jobs.c(j_waitj): when checking for fake ^C, test j->last_proc
1942 status to see if it was signaled and use WTERMSIG to get signal.
1944 * main.c: initialize integer TMOUT parameter to 0; call alarm_init()
1946 * trap.c(alarm_init,alarm_catcher): new functions.
1947 * trap.c(runtraps): if ksh_tmout_leave is set, exit.
1948 * sh.h(TMOUT_EXECUTING,TMOUT_READING,TMOUT_LEAVING,ksh_tmout,
1949 ksh_tmout_state): new enum values/variables.
1950 * table.h(V_TMOUT): new define.
1951 * var.c(special,setspec,unsetspec): added V_TMOUT entry.
1952 * edit.c(x_getc): call intrcheck() if read interrupted.
1954 Thu Aug 25 09:36:54 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1956 * c_test.c(c_test): for argc cases 4 and 5, return the complement
1957 of the expressioin result; for [[ .. ]] expressions, don't parse
1958 based on argc; deleted struct t_op.op_flags field and related
1959 defines UNOP,BINOP,ACCEPT_BE,ISTEST,ISDBRACKET,ISBOTH - changed all
1960 uses to test the value of isdbracket.
1961 * c_test.c(filstat): moved body of filstat() into eval_unop(), deleted
1964 * c_test.c: incorperated changes from J.T. Conlin (jtc@cygnus.com)
1965 for POSIXization of test builtin.
1967 Wed Aug 24 12:16:25 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1969 * new-version.sh: new file - updates date in version.c
1970 * Makefile.in: added new-version.sh to RCSFILES; call new-version.sh
1973 Tue Aug 23 09:28:10 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1975 * made pdksh-5.0.2 distribution
1977 * jobs.c(exchild): don't call restoresigs().
1978 * exec.c(execute): do call restoresigs() (just before execve()).
1980 * c_sh.c(c_trap): ifdef'd out code to print default traps. Too ugly
1981 and it isn't clear POSIX needs it.
1983 * c_ksh.c(c_print): put -e option back in for echo emulation (-R).
1985 * c_sh.c(c_shift): generate error if n < 0.
1987 * c_sh.c(c_trap): use shellf instead of errorf to report errors
1988 (so we can return a value instead of unwinding - POSIX).
1990 * exec.c(execute): if command fails and !FERREXIT, call
1993 * c_sh.c(c_exit,c_return,c_exitreturn): combined c_exit and c_return
1996 Mon Aug 22 09:39:54 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
1998 * eval.c(expand): case XARG: set word to IFS_WORD to force null
1999 words to be created.
2001 * lex.c(yylex): added indquotes flag and code for `...` parsing
2002 (to deal with "`...`" the way sh/at&t-ksh does).
2004 * trap.c(runtrap): don't reset ERR trap.
2006 * sh.h: combnied SS_USER/SS_FORCE flags with RESTORE_CURR et. al.
2007 flags; changed RESTORE_* to SS_RESTORE_*.
2008 * trap.c(setsig): combined restore, force and user flags; changed
2010 * trap.c(setexecsig): use SS_RESTORE_* values as argument.
2012 * table.h: changed LCASE to LCASEV (and UCASE_AL to UCASEV_AL) to
2013 avoid problems with ioctl/tty LCASE define.
2015 * sh.h(struct env): deleted interactive field.
2016 * main.c(shell),exec.c(iopsetup): deleted e->interactive assignment.
2018 * sh.h: made e a struct env * (was struct env); changed all references.
2019 * main.c(newenv): copy loc, flags and interactive fields explicitly.
2021 * var.c(newblock): allocate block structure, don't assume already
2023 * var.c(popblock): free old block structure.
2024 * main.c(main): set e->loc to 0 before calling newblock().
2025 * exec.c(comexec): let newblock() allocate new structure; deleted
2026 l variable (changed references to e->loc).
2027 * table.h: deleted globals variable.
2029 * c_ksh.c(c_print): treat a lone - like --.
2031 * main.c(main),trap.c(inittraps): move SIGINT,SIGQUIT,SIGTERM signal
2032 initialization to inittraps() and do it regardless of FTALKING.
2034 * trap.c(settrap): deleted force trap since probably will never
2035 add -f flag to trap.
2037 * main.c(unwind): if we are dieing of SIGINT or SIGTERM, kill
2038 ourselves with a signal.
2040 * vi.c(x_vi),emacs(x_emacs): if ^C read, call trapsig()/runtraps();
2042 * edit.c(x_read): don't check for -2 return value.
2043 * vi.c(x_vi): check for quit char (^\) and fake SIGQUIT.
2045 * exec.c(comexec): made flags argument volatile.
2047 * misc.c(getn_): new function.
2048 * c_sh.c(c_exit,c_return): call quitenv() before unwind()ing;
2049 moved c_exit() next to c_return(); use getn_() instead of getn().
2051 * main.c(shell): added exit_atend argument to deal with POSIX trap exit
2052 semantics; changed all calls.
2053 * sh.h: added STOP_RETURN macro.
2054 * c_sh.c(c_return): determine if we are returning or exiting before
2055 unwind()ing so POSIX trap exit semantics are honored.
2057 * jobs.c(j_sigchld): call trapsig() instead of messing with sigtraps[].
2058 * trap.c(trapsig): don't restore signal handler if it wasn't set to
2061 * sh.h: added TF_TTY_INTR flag.
2062 * trap.c(inittrap): set TF_TTY_INTR for SIGINT.
2063 * jobs.c(j_waitj): if
2065 * jobs.c,sh.h: deleted SA_RESTART ifdefs; moved SIGCLD->SIGCHLD ifdefs
2066 from jobs.c to sh.h.
2068 Sat Aug 20 15:26:24 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
2070 * sh.h: added KSH_SA_FLAGS define.
2071 * trap.c(inittrap,setsig): set sa_flags field to KSH_SA_FLAGS.
2072 * sigact.c(sigaction): if using BSD42_SIGNALS, set the SV_INTERRUPT
2074 * configure.in: deleted AC_RESTARTABLE_SYSCALLS.
2075 * config.h.bot: add error message to prevent compilation if using
2078 * shf.h: added SHF_INTERRUPT flag.
2079 * shf.c(shf_fillbuf,shf_putchar,shf_write,shf_emptybuf): call
2080 intrcheck() if read()/write() interrupted and SHF_INTERRUPT set.
2081 * c_sh.c(c_read): use SHF_INTERRUPT flag.
2082 * lex.c(getsc_): call intrcheck() if read() interrupted.
2084 * main.c(main),trap.c(inittrap): moved Sigact* initialization
2085 from main() to inittrap(); made Sigact_trap/Sigact_ign static;
2086 deleted Sigact and Sigact_dfl.
2087 * sh.h: deleted declarations of Sigact*.
2089 * main.c(shell): deleted sigaction call - no longer needed.
2091 * sh.h: added RESTORE_CURR, RESTORE_ORIG, RESTORE_DFL and RESTORE_IGN
2094 * trap.c(intrcheck): new function.
2095 * trap.c(runtraps): added intr argument; clear trap/intrsig
2096 before running traps; changed all calls.
2097 * trap.c(runtrap): save/restore exstat when running trap.
2098 * jobs.c(j_waitj): changed interrupt test to check intrsig
2100 * jobs.c(waitfor): if j_waitj() returns -1, call intrcheck().
2101 * jobs.c(j_change): use setsig() instead of sigaction() to
2102 set up SIGTTIN,SIGTTOU,SIGTSTP.
2104 * trap.c(inittraps): initialize flags for INT/QUIT/TERM.
2105 * sh.h(intrsig): new variable.
2106 * trap.c(trapsig): set intrsig if signal has TF_DFL_INTR flag set;
2108 * trap.c(runtraps): clear intrsig.
2109 * trap.c(runtrap): if signal is defaulted and TF_DFL_INTR is
2110 set, set exstat and call unwind(); return if signal ignored;
2111 reset an ERR trap before executing it.
2112 * trap.c(cleartraps): deleted special case for EXIT; reset
2113 command traps using settrap(); clear intrsig.
2114 * trap.c(restoresigs): only deal with traps that have the TF_EXEC_IGN
2115 flag set (others take care of themselves).
2117 * trap.c(sigtraps[]): added ERR trap.
2118 * trap.c(gettrap): deleted #if 0'd ERR/EXIT check.
2119 * trap.c(gettrap,runtrap,cleartraps,restoresigs): use SIGNAL+1 to
2120 go through trap table.
2121 * sh.h(SIGEXIT_,SIGERR_): new defines.
2122 * c_kill.c(c_kill): test for signals > 128 (was >= 128)
2123 * c_sh.c(c_trap): when printing traps, use SIGNALS+1.
2125 * sh.h(struct trap): replaced ourtrap and sig_dfl fields with
2126 flags field; defined TF_SHELL_USES, etc. for flags field; added
2128 * sh.h(struct env): replaced func_parse field with
2129 flags field; defined EF_FUNC_PARSE, EF_BRKCONT_PASS for flags
2130 field; defined STOP_BRKCONT(); changed uses of func_parse
2131 (get_command()/readhere()).
2132 * c_sh.c(c_brkcont): use STOP_BRKCONT(), EF_BRKCONT_PASS; call
2133 unwind() to do the work.
2135 Fri Aug 19 09:59:43 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
2137 * trap.c(settrap): new function - does most of what c_trap did.
2138 * c_sh.c(c_trap): changed to use settrap(); print out default
2139 actions as well as caught/ignored actions.
2140 * trap.c,c_sh.c(setsig): moved setsig from c_sh.c to trap.c and
2141 made it static; added force and user arguments; don't do anything
2143 * main.c(main): use sigtrap() instead of ignoresig().
2144 * trap.c(ignoresig): deleted function.
2146 * exec.c(execute): case TSELECT: don't change SIGINT signal handler.
2148 * proto.h: use GCC_FA_NORETURN on aerror().
2149 * syn.c(yyparse): made function static and void.
2151 * exec.c(herein): changed error() calls to errorf()s; use error()
2152 in error handler; call shf_close() instead of shf_fdclose().
2154 * tree.h,sh.h: moved LBREAK/LCONTIN from tree.h to sh.h;
2155 added LEXIT, LRETURN, LERROR, and LINTR defines; changed values
2156 of LBREAK/LCONTIN; changed all calls to longjmp() and setjmp().
2157 * exec.c(execute): put Break: label after main switch, changed
2158 goto Break[0-9] to Break; deleted Break[0-9] labels.
2159 * exec.c(execute): changed FOR, SELECT, WHILE, DO loop setjmps
2160 to explicitly check for LBREAK/LCONTIN, otherwise call unwind().
2161 * exec.c(execute): case TFUNC: added setjmp switch statement to take
2162 care of various L* values.
2163 * main.c(include,shell): added setjmp switch statement to take care of
2165 * main.c(unwind): added L* parameter to pass on to longjmp();
2167 * c_sh.c(c_return): just call unwind(LRETURN);
2168 * main.c(unwind): put code from leave() in E_NONE case.
2169 * main.c(error,leave): deleted functions; replace all calls with
2170 unwind(LLEAVE or LERROR).
2171 * *.c(longjmp): replaced all calls with unwind(L..) (except the
2174 * shf.h: add areap field to struct shf.
2175 * shf.c(shf_fdopen,shf_sopen): initialize areap
2176 * shf.c(shf_emptybuf,shf_close,shf_sclose,shf_finish): use areap
2179 * shf.c(shf_sopen): if buf is 0 and writing and DYNMAIC, allocate
2180 a buffer; if writing, save room for a trailing null.
2181 * shf.c(shf_sclose): new function.
2182 * shf.c(shf_snprintf),tree.c(snptreef): use shf_sclose().
2183 * tree.c(snptreef): changed return type to char *; if buffer
2184 is null, pass SHF_DYNAMIC to shf_sopen(); return (possibly
2186 * syn.c(syntaxerr): use snptreef() instead of ident.
2188 * tree.h: new define TDBRACKET; new defines DB_NORM,DB_OR,DB_AND,
2190 * tree.c(ptree): added case for TDBRACKET.
2191 * syn.c(get_command): case DBRACKET: make TDBRACKET command;
2192 at end of function, null terminate args/vars if TDBRACKET.
2193 * c_test.c(is_db_patop): new function.
2194 * syn.c(db_primary): set type of arg to DB_PAT if is_db_patop()
2196 * exec.c(execute): added case for TDBRACKET.
2198 * syn.c(get_command): case MDPAREN: make arg[0] an allocated stuffed
2199 string (was a literal string).
2201 Thu Aug 18 11:06:49 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
2203 * c_test.c(is_op,is_binop,is_unop): new functions to test for
2204 unary/binary operators.
2205 * c_test.c(oexpr,aexpr,nexpr,primary): no longer take argument -
2206 call is_unop/is_binop directly.
2207 * c_test.c(ISDBRACKET,ISTEST,ISBOTH,ACCEPT_BE): new defines.
2208 * c_test.c(struct t_op): changed op_type field to op_flags.
2209 * c_test.c(ops[]): broke into two arrays: u_ops and b_ops;
2210 set flag field to ISDBRACKET/ISTEST/ISBOTH as appropriate.
2211 * c_test.c(t_lex): deleted function.
2212 * c_test.c(primary): before checking for unary operator, check
2213 for -BE (binary expression next) if appropriate.
2215 * c_test.c: made operator type an enum to make it easier to add
2216 operators; changed oexpr/aexpr/nexpr/primary/filstat/t_lex
2217 operand/return types.
2218 * c_test.c(struct t_op): changed op_text from char * to char [4].
2219 * c_test.c(primary): case FILTT: using digit(**t_wp) causes core dump
2220 when there is no arg - just test if *t_wp is 0; move test into
2222 * c_test.c(primary): use *opnd1 != 0 instead of strlen(opnd1) (3
2225 * tree.c(wdscan,wdcopy): changed string argument to const; changed
2226 return type of wdscan to const.
2228 * eval.c(expand): case CSUBST: case '?': use st->var->anme instead
2229 of cp to allow proper nesting.
2230 * eval.c(expand): case OSUBST: don't change cp - declare local
2232 * eval.c(expand): case COMSUB: deleted Xsavepos() call; XCOM: deleted
2234 * eval.c(expand): save the position of the first unquoted = for tilde
2236 * eval.c(expand): case '~': use sp == (cp+2) instead of dp == Xstring
2237 so we aren't fooled by ''~ or ${foo}~; sp[-1]/sp[-2] and firsteq
2238 for the DOASNTILDE after first = or unquoted : test.
2240 * tree.h(struct op): changed noexpand field to evalflags; changed
2242 * exec.c(execute): if t->evalflags is non-zero, pass them to eval().
2244 * lex.h: added DBRACKET define for [[ keyword.
2245 * syn.c(get_command): added case for DBRACKET.
2246 * syn.c(db_parse,db_oaexpr,db_nexpr,db_primary): new functions
2247 to parse [[ .. ]] expressions.
2248 * syn.c(tokentab[]): added [[/DBRACKET keyword.
2249 * c_test.c(is_db_unop,is_db_binop): new functions to test if arg
2250 is [[ .. ]] unary/binary operator.
2252 * syn.c(syntaxerr): call REJECT; before token; removed REJECT
2253 before all calls to syntaxerr().
2254 * syn.c(get_command): removed syntax error kludge.
2256 Wed Aug 17 11:07:40 NDT 1994 Michael Rendell (michael@arlene.cs.mun.ca)
2258 * c_test.c(struct ops): changed -U to -O.
2260 * tree.h: added new defined DOASNTILDE.
2261 * eval.c(expand): case '~': changed !(f&DOBLANK) to f&DOASNTILDE.
2262 * exec.c(execute): case TCOM: pass DOASNTILDE when evaluating vars
2263 and when expanding args when t->noexpand is set.
2265 * exec.c(execute): case TCASE: pass DOTILDE to both evalstr() calls
2268 * syn.c(get_command): don't check for redirections before determining
2269 command type; handle REDIR where LWORD are handled; default case
2270 always returns; pass ARRAYVAR flag to tpeek() if t->noexpand;
2271 don't allow redirections before "x()" function; don't allow
2272 redirection before keywords; allow a '(' in the case LWORD/REDIR:
2273 if no variables or arguments (POSIX doesn't allow this, but
2274 at&t ksh/bourne sh do).
2275 * lex.h(ARRAYVAR): new define.
2276 * lex.c(yylex): parse x[1 & 2] as one word if VARASN|ARRAYVAR.
2278 * var.c(is_wdvarname): added aok argument; changed all calls.
2279 * syn.c(get_command): case FOR/SELECT: check identifier is valid.
2281 * c_sh.c(c_trap): use print_value_quoted() to print traps;
2282 use ksh_getopt() to skip possible --.
2283 * trap.c(gettrap): allow digits only if signal numbers match
2284 POSIX values (ie, HUP=1,INT=2,QUIT=3,ABRT=6,KILL=9,ALRM=14,TERM=15).
2286 * misc.c(print_value_quoted): new function to print strings with
2287 appropriate quoting.
2288 * c_ksh.c(c_typeset,c_alias): use print_value_quoted() when printing
2291 * lex.h: added new ESACONLY flag - only accept ESAC keyword.
2292 * lex.c(yylex): check for ESACONLY flag when doing keyword search.
2293 * syn.c(caselist): pass ESACONLY flag to tpeek().
2295 Tue Aug 16 10:17:47 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2297 * lex.h(struct source); changed echo field to generic flags field;
2298 defined SF_ECHO and SF_ALIASEND.
2299 * lex.c(_getsc): case SALIAS: use isspace() to check for trailing
2300 space in alias; if alias does not end in a space, return a fake
2301 space to keep the current alias in the source list - this allows
2302 recursive alias detection; set SF_ALIAS in next source if alias
2304 * lex.c(yylex): deleted expanding_alias, rec_alias_cnt and
2305 rec_alias_table variables; check for recursive aliases by checking
2306 the source list; don't use EXPALIAS flag; if SF_ALIAS is set in
2307 current source, set ALIAS flag and clear SF_ALAIS; deleted global
2309 * table.h: deleted EXPALIAS define.
2310 * main.c(shell): changed s->echo to set/clr of SF_ECHO in s->flags.
2312 * table.h: added aliases and keywords tables; deleted lexicals table
2313 (POSIX says they are separate).
2314 * syn.c(keywords,initkeywords): changed name of keywords() function
2315 to initkeywords(); changed all calls; add to keywords table instead
2317 * main.c(main): initialized aliases/keywords tables; deleted
2318 initialization of lexicals table.
2319 * c_ksh.c(c_whence,c_alias,c_unalias),lex.c(yylex): use
2320 keywords/aliases tables instead of lexicals table; removed unneeded
2321 type == CALIAS checks.
2323 * var.c(getint): new function, largely take from strint().
2324 * var.c(strint): call getint() to do most of the work; if vq
2325 was an allocated string, free the string and clear the alloc
2327 * var.c(intval): call getint() instead of strint().
2329 * mail.c(mcheck): use getint() instead of strint() when getting
2332 * var.c(skip_varname): added argument to allow array references;
2334 * var.c(set_array): remove valid variable name check - done in
2337 * var.c(strint): check if getspec()/setspec() need to be called.
2338 * var.c(intval): remove getspec()/INTEGER checks - let strint() do it.
2340 * var.c(skip_wdvarname,is_wdvarname,is_wdvarassign): new
2342 * lex.h(VARASN): new define indicating variable assignment expected,
2343 currently used to parse "x[1 & 2]" as one token - may be used
2344 in future in returning AWORD (assignment word) to the parser.
2345 * lex.c(yylex): Subst: case '[': use is_wdvarname() in determining
2346 whether to parse an array dereference; do not require an = after the
2347 dereference (typeset -r x[1 & 2] is legal).
2348 * syn.c(many functions): pass VARASN to token/musthave/tpeek/synio
2349 when ever the next token might be the first word of a simple
2351 * syn.c(get_command): case LWORD: use is_wdvarassign() to distinguish
2352 variable assignments from normal arguments; allow aliases after
2353 redirections and variable assignments; generate syntax error
2354 for "foo=bar bogusfunction()"; allow array variables in for
2355 and select statements.
2356 * lex.c: make global alias variable static (no longer used by
2359 * syn.c(get_command): put MDPAREN into its own case.
2361 * lex.c(yylex): deleted place holder for tilde expansion.
2363 * tree.h(struct tree): added noexpand field for
2364 alias/export/readonly/typeset.
2365 * syn.c(newtp),tree.c(tcopy): initialize/copy noexpand field.
2366 * syn.c(get_command): case LWORD: set noexpand if assign_command()
2368 * syn.c(assign_command): new function - returns true if command
2369 is alias, export, readonly or typeset.
2370 * exec.c(execute): case TCOM: don't pass DOTILDE flag when
2371 expanding t->vars; don't do field splitting/globbing/tilde expansion
2372 of t->args if t->noexpand is set.
2374 * table.h: re-grouped the struct tbl flags into common, variable,
2375 funtion, builtin/alias, etc (some values overlap); new flag
2376 names: KEEPASN (was overloaded with TRACE) and NOEXPAND.
2377 * exec.c(comexec,builtin): changed TRACE to KEEPASN.
2379 * tree.c(tcopy): when copying t->str, use strsave(), not wdcopy()
2380 if not copying a TCASE.
2382 * c_ksh.c(c_typeset): added -p flag for POSIX export/readonly.
2384 * eval.c(expand): expand tilde in place; don't do tilde expansion
2385 on results of substitution (POSIX); only do tilde expansion
2386 if login name is unquoted (POSIX); don't check for fdo&DOTILDE
2387 when a word is completed.
2388 * eval.c(tilde): changed to return home directory of a given login name
2389 (taking care of null/+/-) (old version copied string, scanning
2390 for, and replacing, magic tildes).
2392 * exec.c(findcom): don't create commands table entries when
2393 not inserting; when doing access test of tracked alias,
2394 check for ISSET, not ALLOC (but test ALLOC before calling afree).
2395 * exec.c(search): use strcpy() instead of loop.
2397 Mon Aug 15 14:46:58 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2399 * c_ksh.c(c_print): added at&t ksh -R flag; deleted -e flag;
2400 changed to use ksh_getopt().
2401 * main.c(initcoms[]): changed echo alias from 'print -' to 'print -R'.
2403 * sh.h: new variable procpid; added pid field to struct temp.
2404 * jobs.c: changed references to my_pid to procpid; deleted my_pid
2406 * io.c(maketemp): initialize pid field from procpid.
2407 * main.c(remove_temps): only remove temporary files created by
2408 the current process.
2410 Sun Aug 14 11:47:05 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2412 * var.c: added var field to struct Expand and struct SubType; deleted
2413 struct SubType.name field.
2414 * var.c(expand): case OSUBST: use x.var/st->var field to save result
2415 of global() for use in case CSUBST - this avoids problems with
2416 x[i+=1] being evaluated twice; check to see if value is being
2417 assigned to non-variable (eg, ${*:=aja}) or read-only variable.
2418 * var.c(varsub): set value of xp->var; possibly generate error if
2419 FNOUNSET set when expanding ${#*}, ${#var}, or ${#array[*]}.
2421 * table.h: added struct tbl.areap field to get rid of lastarea
2422 problems; deleted lastarea variable; changted all refernces
2423 to lastarea to var->areap.
2424 * table.c(tenter): initialize areap field.
2425 * var.c(arraysearch): deleted area parameter; initialize areap field.
2426 * var.c(global,local,intval,setint): initialize areap field of vtemp.
2428 Fri Aug 12 10:54:51 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2430 * expr.c: re-wrote e*() functions using single function and table;
2431 token() now does table lookup; added full C expressions (sans
2432 pre/post increment, sizeof).
2434 * table.h(INT_U,INT_L): new flags.
2435 * var.c(strval): handle INT_U.
2436 * c_ksh.c(c_typeset): add exclusions for INT_U/INT_L;
2437 add -U option for unsigned (non-at&t ksh).
2439 * var.c(set_array): use global() instead of local();
2441 * var.c(global): when parsing $123, don't limit number to 1000.
2443 * expr.c(v_evaluate): like old evaluate, but assigns result to
2445 * expr.c(evaluate): changed to use v_evaluate().
2446 * expr.c(e0): when parsing literals, use strint() instead of setstr().
2448 * var.c(setstr): when assigning to integers, use v_evaluate() instead
2451 Thu Aug 11 11:33:17 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2453 * var.c(strint): don't change anything until number completely
2454 parsed; don't clear ISSET flag if parsing fails; fail parse
2455 if non-integer/non-letter found; default base if copying from
2456 integer variable; set ISSET if parsing succeeds.
2458 * expr.c(tempvar): set vp->val.i to 0.
2459 * expr.c(token): when skipping a literal number, don't allow _;
2460 use isspace() to skip.
2461 * expr.c(asn): use strint()/setstr() instead of setint().
2462 * expr.c(e0): added unary ~ and + (posix).
2464 * var.c(global,local): always call substitute on contents of [..];
2465 free sub when finished eval.
2467 * ksh_limval.h: new file.
2468 * shf.c: use ksh_limval.h.
2469 * Makefile.in: added ksh_limval.h to HDRS.
2471 Wed Aug 10 10:57:01 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2473 * c_ksh.c(c_whence): case CFUNC: print exported/traced/undefined,
2474 do not print function definition.
2475 * exec.c(findcom): new argument indicated if functions to be
2476 autoloaded; changed all calls.
2478 * misc.c(ksh_getopt): added # option modifier for typeset.
2479 * c_ksh.c(c_typeset): changed to use ksh_getopt(); added
2480 -L, -R, -Z, -l, -u flags; quote variable values when printing;
2481 generally re-arranged function.
2482 * table.h: added LJUST,RJUST,ZEROFIL,LCASE,RCASE; deleted FUNCT.
2483 * exec.c(findfunc): new function.
2484 * exec.c(define,findcom): use findfunc(); skeleton autoload code.
2485 * var.c(typeset): added two arguments for initial field width and
2486 base; changed all calls; deal with LJUST,.. flags; re-arrange to
2487 have one loop iterating over array; do readonly check before
2488 changing attributes.
2489 * var.c(strval): deal with LJUST,.. flags when getting integers.
2490 * var.c(setstr): deal with LJUST,.. flags when setting strings.
2491 * var.c(setstr): deal with LJUST,.. flags when setting strings.
2492 * var.c(arraysearch,tenter): initialize {new,p}->field to 0.
2493 * table.h: added struct tbl.field.
2495 * siglist.in: changed signal messages to be more or less the
2496 same as sys_siglist[]; moved SIGUNUSED before SIGBUS.
2497 * jobs.c(j_print): assume sigtrap[].mess always valid; use
2498 sigtrap[].mess directly for stopped processes.
2500 * aclocal.m4(KSH_SYS_SIGLIST): new macro like KSH_SYS_ERRLIST.
2501 * configure.in: use KSH_SYS_SIGLIST instead of AC_SYS_SIGLIST_DECLARED.
2503 Tue Aug 9 10:28:45 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2505 * version.c: removed RCS logs since version numbers don't match
2508 * configure.in: added AC_PROG_CPP
2509 * Makefile.in: added rules for generating siglist.out
2510 * siglist.in,siglist.sh: new files.
2511 * trap.c(inittraps,deftraps[]): deleted deftraps[]; initialize
2512 sigtraps[] directly by including siglist.out.
2514 * tree.h: added EXPRSUB for $((..)), re-numbered defines.
2515 * tree.c(tputS,wdscan): added case for EXPRSUB.
2516 * eval.c(expand,alt_count,alt_scan): added case for EXPRSUB.
2517 * lex.h: added SDDPAREN for $((..)).
2518 * lex.c(yylex): added case for SDDPAREN.
2520 * lex.c(yylex): case SPAREN: match parenthesis using counter instead
2521 of pushing/poping states.
2523 * lex.h: re-numbered S* defines to be sequential; added SREREAD.
2524 * lex.c(yyerror): pop SREREADs.
2525 * lex.c(getsc_): added case for SREREAD.
2526 * lex.c(arraysub): changed to save whatever is read and return a value
2527 indicating if brackets matched; changed all calls.
2528 * lex.c(yylex): if brackets in array reference are not balanced,
2529 or if array reference not followed by an =, re-read the input.
2531 Mon Aug 8 21:20:08 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2533 * sh.h: fix lseek prototype (from sjg@zen.void.oz.au)
2535 * configure.in,jobs.c: added HAVE_SYSCONF; don't use sysconf() unless
2536 HAVE_SYSCONF defined (for NetBSD-Feb12 from sjg@zen.void.oz.au).
2538 * jobs.c(put_job): removed PJ_ON_END case and define (not used).
2540 Wed Jul 27 10:19:42 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2542 * made pdksh-5.0.1 distribution
2544 * exec.c(comexec): when doing exec has no command, fall through
2545 and do variable assignments.
2547 * c_ksh.c(c_let): complain if there are no arguments.
2549 * exec.c(comexec): if XEXEC is set, exit after executing
2550 (builtin/function) command; deleted FERREXIT code; don't set
2552 * exec.c(execute): handle FERREXIT; set exstat to rv for all
2555 * lex.c,syn.c: changed calls to errorf to yyerror (except the
2557 * lex.h(struct source): added errline field.
2558 * lex.c(yyerror): now a varargs function; if source->errline field is
2559 non-zero, print it instead of source->line.
2560 * syn.c(syntaxerr): set source->errline if read EOF in a multiline
2563 Tue Jul 26 11:22:06 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2565 * lex.h(SYNTAXERR,INP): deleted macros.
2566 * lex.h(HISTORY): upped to 128 as per POSIX.
2567 * lex.h,syn.c(multiline): moved from lex.h to syn.c.
2568 * tree.c(vfptreef): added %R to format I/O redirections.
2569 * tree.c(pioact): don't output unit more than once; print unit
2570 only if it isn't the default for the action; print only
2571 one opening quote for quoted here documents; print <> for
2572 read-write (was ><).
2573 * syn.c(zzerr, syntaxerr): replaced zzerr function with new syntaxerr
2574 function; changed uses of SYNTAXERR to syntaxerr() calls; print
2575 out the last unused token; if in a multiline command when EOF
2576 encountered, print token that was unmatched.
2578 * tree.h(TBANG),lex.h(BANG): for POSIX ! keyword
2579 * tree.c(ptree),exec.c(execute): added case for TBANG.
2580 * syn.c(restab[]): added ! keyword.
2581 * syn.c(get_command): added case for BANG (!).
2583 * tree.h(XERROK): new define to allow non-zero exits to be
2584 ignored in certian circumstances (set -e).
2585 * exec.c(execute): pass XERROK to recursive execute() calls; set
2586 XERROK when evaluating conditional part of if/while/until/&&/||.
2587 * exec.c(comexec): pass XERROK on to functions; don't exit if
2590 * jobs.c(async_pid): new variable needed since async_job may go
2591 away, but $! should still be expanded.
2592 * jobs.c(j_async): return async_pid.
2593 * jobs.c(j_set_async): set async_pid.
2595 Mon Jul 25 14:15:25 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2597 * misc.c(parse_args): changed to use ksh_getopt().
2599 * c_sh(c_set): deleted call to resetopts() - neither POSIX nor
2600 at&t ksh touch OPTIND when positional parameters are changed.
2601 * exec.c(comexec): changed resetopts() call to getopts_reset(1) - this
2602 is not a proper fix - should declare a local optind.
2604 * misc.c(builtin_getopt,ksh_getopt): renamed builtin_getopt to
2605 ksh_getopt (shorter); changed to use state structure instead
2606 of static variables; changed all calls; optionally allow + to
2607 introduce an option; don't skip lone - (or +) in arguments - set
2608 optind to point to it.
2609 * misc.c(ksh_getopt_reset): changed to use state structure instead
2610 of static variables.
2611 * sh.h(Getopt): new structure for ksh_getopt() state.
2612 * exec.c(call_builtin): call ksh_getopt_reset().
2613 * c_ksh.c(c_getopts,getopts_reset): new getopts implementation that is
2614 POSIX complient and uses ksh_getopt() routine.
2615 * var.c(setspec): call getopts_reset() when OPTIND set.
2616 * getopts.c: deleted file.
2617 * Makefile.in: deleted getopts.c and getopts.o.
2618 * options.h(FASCIST): deleted option.
2620 Thu Jul 21 09:52:03 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2622 * made pdksh-4.9+mun.5 distribution
2624 * syn.c(get_command),shf.c(shf_fdopen,shf_sopen,shf_emptybuf):
2625 added cast to alloc()/aresize() calls.
2626 * sh.h: changed enum flags_enum to enum flags.
2627 * misc.c(change_flag): changed type of first argument to enum flag.
2628 * edit.c(set_editmode): change type of static array to enum flag.
2630 * edit.c(x_init): initialize tty chars to -1, except for werase,
2632 * edit(x_mode): split oldedchars structure declaration and
2633 initalization (some old compilers don't like them combined).
2635 * c_test.c: made -h work like -L.
2637 Wed Jul 20 11:12:52 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2639 * config.h.top: moved compile options into options.h; include
2641 * options.h: new file.
2643 * c_ksh.c(c_fgbg): if !FPOSIX, set return job exit status.
2645 * jobs.c(j_jobs,j_notify): use JF_REMOVE to flag jobs to delete
2646 after all notification done (to prevent multiple + or - jobs).
2648 * jobs.c(put_job): new funtion, takes argument to specify where
2649 to put job; changed all calls to put_job_on_front and
2650 put_job_on_end to use this; put background processes just
2651 after stopped jobs (instead of at end) (POSIX).
2652 * jobs.c(put_job_on_front,put_job_on_end): deleted.
2654 Tue Jul 19 10:33:55 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2656 * aclocal.m4(AC_MMAP): copied from autoconf's acspecific.m4 and
2657 modified to use the MAP_FILE flag if available.
2659 * misc.c(change_flag): ifdef use of FVI/FEMACS/FGMACS.
2661 Mon Jul 18 13:19:29 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2663 * sh.h(async): deleted.
2664 * var.c(global): call j_async() instead of using async global.
2665 * jobs.c(j_async,j_set_async()): new functions.
2666 * jobs.c(j_startjob): new function.
2667 * jobs.c(exchild,j_waitlast): call j_startjob() to start job.
2668 * jobs.c(j_sigchld): if any jobs aren't started, note signal
2669 occured and return without calling wait.
2670 * jobs.c(j_resume): allow un-reported dead jobs to be fg'd/bg'd;
2671 if backgrounding, set async job.
2672 * jobs.c(j_jobs,j_notify,j_waitj,check_job,remove_job): re-wrote to
2673 deal with posix `known processes'.
2674 * jobs.c(j_lookup()): if number specified, see if it is a lpid first,
2675 then check for pgrp.
2676 * jobs.c(new_job): added functionality of j_newjob().
2677 * jobs.c(j_newjob): deleted function and all calls.
2679 * tty.c(tty_init,tty_close): new functions which initialize
2680 tty_fd, tty_state and tty_devtty.
2681 * jobs.c(j_init,j_change): use tty_init()/tty_close(); changed
2682 references of ttyfd to tty_fd; moved tty_fd, tty_state and
2683 tty_devtty to tty.h; call tty_init() if !FMONITOR; save/restore
2684 tty modes on foreground job completion if FTALKING (was FMONITOR).
2685 * edit.h(X_chars): new structure for tty driver characters (replaces
2686 ed_erase, ed_kill, ed_werase, ed_intr, ed_quit); moved prototypes
2687 for emacs.c and vi.c from proto.h to edit.h; changed all references
2688 to ed_* to edchars.*.
2689 * edit.c(x_mode): use tty_state instead of cborig; re-initialize
2690 tty state from tty_state whenever entering xmode; save tty characters
2691 in edchars structure.
2692 * edit.c(x_init): now called from main(); initializes edchars, x_cols,
2693 and calls x_init_emacs.
2694 * emacs.c(x_init_emacs): changed erase,kill,werase,intr,quit arguments
2695 to X_chars argument.
2697 Fri Jul 15 10:35:13 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2699 * io.c(restfd): only flush if fd is 2; use dup2() instead of
2700 fcntl(F_DUPFD) (2 system calls instead of 3).
2702 * ksh_wait.h(WEXITSTATUS): changed mask from 0x7f to 0xff.
2704 * tty.h: added TTY_state structure.
2705 * tty.c: new file - contains get_tty() and set_tty().
2706 * edit.c(x_init,x_mode): use get_tty() and set_tty().
2707 * jobs.c(j_waitj,j_resume): save/restore tty modes of stopped
2708 jobs, as per POSIX.1, B.2, job control; for foreground jobs,
2709 save tty state after successful completion, restore tty state
2710 after non-successful completion (signaled, non-0 exit, stopped).
2712 * misc.c(options): changed "alternations" to "braceexpand" (this
2713 is what bash uses - no need to invent new option names); changed
2714 ALTERNATIONS define to BRACEEXPAND, same for FALTERNATIONS to
2717 * jobs.c(check_job): if process died of SIGINT or SIGPIPE, leave
2718 job state as PEXITED (not PSIGNALLED).
2719 * jobs.c(j_print): if printing short notice, ignore SIGPIPE the
2720 way SIGINT is ignored.
2722 * exec.c(comexec): flush shl_out after 'not found' message.
2724 * c_ksh(c_kill): re-wrote function (again) to handle posix
2725 options (-s, --, etc.) and posix -l output.
2727 * configure.in: added strcasecmp function check.
2728 * missing.c(strcasecmp): define strcasecmp function if not available.
2729 * trap.c(gettrap): use strcasecmp when comparing signal names.
2731 * var.c(global): expand $! to nothing if there haven't been any
2732 asynchronous processes started yet.
2734 * misc.c(options): added posix option (set automatically if
2735 POSIXLY_CORRECT env variable is set or if POSIXLY_CORRECT config
2737 * var.c(special,setspec): added POSIXLY_CORRECT.
2738 * config.h.top: added POSIXLY_CORRECT define.
2739 * main.c(main): set FPOSIX if POSIXLY_CORRECT is defined.
2740 * POSIX: new file describing what the posix flag controls.
2742 Thu Jul 14 10:53:15 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2744 * jobs.c,sh.h(killpg): moved killpg define to sh.h.
2746 * jobs.c(exchild): set async variable when starting background
2748 * jobs.c(j_resume): print [job-num] before command when backgrounding;
2749 print to stdout instead of stderr.
2750 * c_ksh.c(c_fgbg): call builtin_getopt to skip possible --, complain
2751 about unknown options.
2753 * jobs.c(held_sigchld): new global variable.
2754 * jobs.c(j_sigchld): if any jobs aren't started, set held_sigchld and
2756 * jobs.c(exchild,waitlast): after setting JF_START, if held_sigchld
2757 set, call j_sigchld().
2759 * jobs.c(exchild): added/initialized ppid field to struct job; deleted
2761 * jobs.c(waitfor): don't wait for a process that isn't a child of
2762 the current process.
2763 * jobs.c(j_exit): kill stopped jobs owned by current process only.
2765 * jobs.c(check_job): don't do monitor stuff for XXCOM jobs, but do
2766 set up notification.
2767 * jobs.c(j_waitj): added JW_NOTIFY flag to print job notification
2770 * jobs.c(exchild): remove !XPIPEI condition - we now close pipe so
2771 pipeline doesn't have to call waitlast().
2772 * exec.c(execute): case TPIPE: no need to restore 0 or call waitlast()
2773 since exchild() handles everything.
2775 * jobs.c(remove_job): set last_job to 0 if we are removing it.
2776 * jobs.c(waitlast): check if last_job is 0.
2778 * jobs.c(struct job): combined started, waiting, interactive
2779 field into flags field; added JF_* flags; changed JW_NONOTIFY
2780 to JW_NOTIFY and changed all calls to j_waitj() to reverse
2783 * jobs.c(exchild): ignore SIGTSTP, TTIN, TTOU for `command` jobs.
2785 Wed Jul 13 09:28:34 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2787 * main.c(main): when checking if FMONITOR set on command line,
2788 use 127 instead of -1 (signed vs unsigned char problem).
2790 * tree.h: renumbered, XEXEC, XFORK, ... and DOBLANK, DOGLOB, ...
2791 to use bits in order (instead of 0 5 2 4...).
2792 * jobs.c(j_init): don't set sigtrap[SIGCHLD].sig_dfl = 1 as a
2793 forked child may be a shell that needs to trap SIGCHLD.
2795 * tree.h(XPCLOSE,XCCLOSE): flags for close in parent, close in child.
2796 * jobs.c(exchild): added third argument - a file descriptor - if
2797 flags has XPCLOSE, close fd in parent, if flags has XCCLOSE, close
2799 * exec.c(execute): pass input side of pipe to exchild() so it can
2800 be closed in the child.
2802 Tue Jul 12 10:21:57 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2804 * main.c(main): let ignoresig() handle SIGTERM.
2805 * jobs.c(exchild): let restoresigs handle SIGTERM.
2807 * lex.c(yylex): don't parse array references inside double quotes
2810 * emacs.c(x_print): use shprintf instead of shellf so the output
2811 of bind can be redirected.
2813 * trap.c(deftraps): added SIGINFO (from jconklin@netcom.com).
2815 Fri Jul 8 09:37:51 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2817 * made pdksh-4.9+mun.4 distribution
2819 * Makefine.in: added $(LDSTATIC) to LDFALGS to make static
2820 linking easier (suggested by sjg); use cp -p when creating
2821 distributions to preserve file dates.
2822 * configure.in: set LDSTATIC in Makefile if present in environ
2823 when configure is run.
2825 * sigact.c(sigsuspend): when calling 4.2bsd sigpause, pass *mask,
2828 * main.c(main): fixed up initialization of PWD (free memory, print
2829 more informative message).
2831 * misc.c(getcwd): range check backwards.
2833 * c_sh.c(setsig): set sa_flags/sa_mask.
2835 * edit.c(init_editmode),main.c,proto.h: deleted function - not needed
2836 since VISUAL/EDITOR are special.
2838 * lex.c(set_prompt),table.h: take out PS3.
2840 * c_sh.c(c_umask): handle multiple actions in symbolic mode clauses
2841 (eg, u+r-w); handle X (eg, o+X); ignore s (eg, u+s).
2843 * shf.c(shf_fillbuf): continue reading if we get an EINTR.
2844 * shf.c(shf_emptybuf,shf_write,shf_putchar): continue writing if we
2847 Thu Jul 7 10:19:24 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2849 * sigaction,sigprocmask: changed NULL third argument to
2850 (struct sigaction *) 0.
2851 * sh.h(kshpid): changed type from int to pid_t.
2852 * proto.h(do_ulimit): removed do_ulimit() declaration.
2853 * vi.c(complete_word): removed unused variable pos.
2854 * syn.c(pipeline,elsepart): removed unused variable c.
2855 * jobs.c(exchild): deleted variable s (assigned but not used).
2856 * history(hist_init),shf.c(shf_gets): changed variable e to end
2857 because there is a global e.
2858 * exec.c(do_selectargs): removed secondarg argument; changed return
2859 (char *) 1 to (char *) 0; changed all calls.
2861 * io.c(canseek): use fd argument instead of 0.
2863 * lex.c(readhere): don't use fixed sized buffer (line).
2865 * expand.h: changed multi-statement macros to use do {..} while (0);
2866 changed temporary variable vp to vp__ to avoid lint complaints.
2868 * aclocal.m4(KSH_DUP2_CHECK): define F_GETFD/F_SETFD if not
2871 * etc/profile, etc/ksh.kshrc: replaced with new versions from
2872 Simon J. Gerraty (sjg@zen.void.oz.au).
2874 Wed Jul 6 10:09:55 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2876 * jobs.c(killpg),configure.in: restored use of killpg() - some
2877 systems don't understand kill(-pgrp, signal) (ultrix 2.2);
2878 added test for killpg() in configure.in.
2880 * trap.c(inittraps): changed initialization of sigtraps - was
2881 using -1 in deftraps[] as end of table marker but some systems
2882 (eg, ultrix 2.2) define signals with -1 values (SIGPWR).
2884 * Makefile.in(mandir,install): fixed mandir value; added /
2885 in man installation; prefixed ksh.1 with $(srcdir).
2887 * jobs.c(j_init): Ignore failure of TIOCSETD.
2889 * misc.c(options[]): changed "vicomplete" to "vitabcomplete".
2891 * emacs.c(x_e_putc,x_e_puts,x_debug_info): x_e_putc()/x_e_puts() are
2892 the x_putc()/x_puts() functions from ksh4.9 edit.c (they got lost
2893 in the merge); same for x_debug_info(); changed x_e_putc/x_e_puts
2894 to call x_putc/x_puts.
2896 Mon Jul 4 09:29:05 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2898 * made pdksh-4.9+mun.3 distribution
2900 * main.c(remove_temps): use unlink() instead of remove(); delete
2903 * sh.h(func_heredocs, struct env): added func_heredocs for here
2904 documents in functions; added func_parse field to struct env
2905 - set when a function is being parsed.
2906 * lex.c(readhere): if e.func_parse, save temp file in func_heredocs.
2907 * syn.c(get_command): increment/decrement func_parse when parsing
2909 * main.c(remove_temps,reclaim,leave): added remove_temps(); make
2910 reclaim() call remove_temps(); make leave() clean up function
2913 * aclocal.m4(KSH_TIMES_CHECK): new test - define TIMES_BROKEN
2914 if times() doesn't exist or if it always returns 0.
2915 * acconfig.h(TIMES_BROKEN): new define.
2916 * missing.c(ksh_times): new function.
2917 * ksh_times.h: new file.
2918 * c_sh.c,jobs.c: changed <sys/times.h> to "ksh_times.h"
2919 * c_sh.c,ksh_time.h(CLK_TCK): moved CLK_TCK define from c_sh.c
2920 to ksh_time.h (needed in missing.c).
2922 * syn.c(get_command): case TIME: don't call pipeline() with CONTIN
2925 * c_sh.c(c_times): combined some printfs().
2927 * jobs.c(j_jobs,j_kill,j_resume,waitfor): block SIGCHLD before
2928 calling j_lookup() or looking at jobs list - avoids potential
2929 problems with remove_job() being called in signal handler.
2931 Sun Jul 3 11:09:01 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2933 * exec.c(do_selectargs, selread, pr_menu): re-wrote do_selectargs to
2934 let c_read() to most of the work; deleted selread; make pr_menu
2935 calculate width/ncolumns each call so select can be used recursively.
2937 * configure.in, aclocal.m4(KSH_TERMIOS_H, KSH_TERM_CHECK): replaced
2938 KSH_TERMIOS_H with KSH_TERM_CHECK; removed calls to
2939 tcgetpgrp/tcsetpgrp - there is a separate test for this.
2941 * main.c(main), sh.h: move getcwd() declaration to sh.h.
2943 * eval.c(expand,varsub): added XNULLSUB case to deal with "$@"
2944 (and "${foo[@]}") when $# (or ${#foo}) is 0.
2946 * eval.c(expand,varsub): removed free_me field - let reclaim() take
2949 Wed Mar 9 00:50:12 1994 Simon J. Gerraty (sjg@zen.void.oz.au)
2951 * var.c (setstr): don't set ALLOC flag if vp.s is NULL.
2953 Thu Jun 30 10:16:44 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2955 * c_sh.c(c_read): ignore null characters; use builtin_getopt()
2956 instead of explicit parsing; removed -e option (neither at&t ksh
2957 nor POSIX have this); added -s option (put line in history, at&t ksh);
2958 if no variable specified, use REPLY (at&t ksh).
2960 * exec.c(do_selectargs): use Xstring macros to deal with saving
2961 input (was static, growing, buffers); flush shl_out after
2964 * vi.c(expand_word,complete_word): deleted call to free_edstate
2965 since already done by restore_edstate().
2966 * var.c(global): in 'if !letter(c)' block, deleted !c from
2967 'if (!c || !n[1])' - don't know why it was added since it makes
2968 no difference to what is returned.
2970 * syn.c(dogroup): removed onlydone argument since it is only
2971 used in the while/until statements, where "while command; done"
2972 is not allowed anyway; Changed all calls.
2974 * misc.c(options[]): allow -i to be specified on the command
2977 * exec.c(iosetup): if stderr (fd 2) is being re-directed,
2978 re-open shl_out to clear any errors.
2979 * main.c(quitenv): if restoring fd 2, clear any write errors
2980 * io.c(initio): initialize shl_out, shl_spare for writing
2983 * main.c(main): ignore SIGQUIT if talking.
2985 Wed Jun 29 11:11:34 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
2987 * c_sh.c(c_exit): removed jobs/really quit stuff - exit should
2989 * main.c(shell): made reallyquit a local variable.
2990 * sh.h(reallyquit): deleted reallyquit
2992 * exec.c(comexec), main.c(main), misc.c(change_flag), jobs.c:
2993 ifdef'd use of FMONITOR.
2994 * sh.h, misc.c: define FMONITOR option only if JOBS defined.
2996 * c_sh.c(c_wait): POSIXized: option parsing (of no options);
2997 return 0 if not given any arguments; deal with multiple arguments.
2998 * jobs.c(j_lookup): changed second argument to return an integer
2999 error code, added defines for error codes, added error message
3000 array; changed all calls to use new conventions.
3001 * jobs.c(waitfor): returns -1 if job not found; added argument
3002 to specify if notification messages should be suppressed.
3003 * jobs.c(j_waitj): added flags argument instead of intr argument;
3004 added JW_STOPPEDWAIT flag to wait for stopped jobs to complete;
3005 added JW_NONOTIFY flag to suppress notification of normal
3008 Tue Jun 28 16:13:10 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
3010 * c_ksh.c(c_jobs): added -n and -p options, allow job ids to be
3011 specified for -l option.
3012 * jobs.c(j_jobs): added new arguments to deal with -n and -p options.
3014 * shf.h(SHF_BSIZE): reduced size to 512 to reduce memory requirements
3015 (I/O is used mostly for one line messages).
3017 * config.h.bot: removed necessity for tty process groups to define
3018 JOBS, added necessity of signal blocking/pausing.
3020 Mon Jun 27 21:49:52 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
3022 * jobs.c(exchild,j_print,j_waitj,j_jobs,check_job): exchild() - removed
3023 commented out shf_flush() calls; j_print() - print a space between
3024 status reports when lflag < 0, changed flag argument to use
3025 long/medium/short defines; Changed Job.notify field to use
3026 long/medium/short defines; j_waitj() - instead of calling j_print(),
3027 set j->notify to print the job; j_jobs() - clear j->notify so user
3028 won't be notified twice if a job finishes before a jobs command;
3029 check_job() - put job on front of list only if it is stopped.
3031 * main.c(main): pass flag to j_init() indicating if -m flag set/cleared
3032 on command line; don't initialize ttyfd.
3033 * sh.h: delete ttyfd.
3034 * jobs.c(j_init,ttyfd,check_job): made ttyfd static; re-worked j_init()
3035 to initialize ttyfd, initialize FMONITOR if not set by command line,
3036 initialize shl_j for asynchronous job notification;
3037 check_job() - use shl_j, look through saved fds to find real
3040 * jobs.c(TTY_PGRP, ttypgrps_ok): modified conditions so job control
3041 is useful without tty process groups; added ttypgrps_ok flag that
3042 indicates if tty process groups should be set up; modifications so
3043 job control useful if ttypgrps_ok not set.
3045 * main.c(main): set FTALKING if 0 and 2 are tty as specified in POSIX
3048 * misc.c(parse_args): do POSIX option processing for -A, -c and -o
3049 (allow -onoglob, -ctrue).
3050 * main.c(main): don't set up shl_stdout before/after parse_args() since
3051 lone -o on command line no longer accepted; remove code to allow
3052 -c with no options to read from stdin (at&t khs does this but POSIX
3053 requires an option to -c).
3055 Thu Jun 23 17:46:54 NDT 1994 John Rochester (jr@panda.cs.mun.ca)
3057 * trap.c(cleartraps): added special case for clearing trap 0 from
3060 Thu Jun 23 10:17:03 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
3062 * misc.c(builtin_getopt): print error messages for unknown option,
3063 missing option; reset state if argv is 0.
3064 * c_ulimit.c(c_ulimit): let builtin_getopt() print error messages.
3065 * exec.c(call_builtin): call builtin_getopt() with 0 argv.
3067 * c_sh.c(c_unset): added -v option (POSIX); use builtin_getopt() to
3068 parse arguments; removed bogus comment about global() and special
3069 variables; don't allow read-only variables to be unset (POSIX).
3071 * var.c(unset, unsetspec): when unsetting a special variable, call
3072 unsetspec(); unsetspec() new function.
3073 * mail.c(mbset, mcheck): check that path is not 0 before calling stat
3074 (so mbset() can be called with 0 when MAIL is unset); deleted #if 0'd
3075 declarations of munset, mballoc and maddmsg.
3077 * misc.c(parse_args): pass argv+i+1 to set_array (not argv+i); when
3078 skipping arguments, leave i just before the NULL.
3080 * exec.c(echo): flush shl_out when done.
3082 * shf.c(shf_close): always used to return EOF.
3084 * trap.c(trapsig): skip error handlers when checking for PARSE or LOOP.
3086 Wed Jun 22 10:24:09 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
3088 * sh.h(C_IFSWS), misc.c(initctypes): added and initialized C_IFSWS
3090 * c_sh.c(c_read): print continuation prompt if line ends in backslash;
3091 multiple non-white-space IFS chars delimit fields; strip trailing
3092 IFS-white-space from last variable; watch out for backslash followed
3094 * eval.c(expand): only do field splitting on the results of
3095 parameter/command substition (POSIX, !v7-sh); multiple
3096 non-white-space IFS chars delimit fields.
3098 * eval.c(expand,alt_expand): removed NOALT tests since it could
3099 never be set; added return after call to alt_expand() in expand().
3101 Mon Jun 6 10:12:41 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
3103 * misc.c(setctypes, initctypes): setctypes - don't allow leading null
3104 in IFS (IFS="" could cause problems, 0 is already added);
3105 initctypes - don't use a leading null.
3107 * sh.h, eval.c: move definition of ifs0 from eval.c to sh.h; handle
3109 * var.c(setspec): set ifs0 to first character of IFS.
3111 * lex.c(yylex): when parsing ${..}, array references were not being
3114 Fri Jun 3 12:28:06 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
3116 * var.c(export): changed to use memcpy() instead of loops.
3118 * eval.c(varsub, expand): check for #foo[@] in addition to #foo[*];
3119 handle ${foo[*]} and ${foo[@]} - added free_me field to struct Expand
3120 so pointer vector can get freed.
3122 * c_sh.c(c_dot), main.c(include): set up positional parameters if
3123 any are specified; Added argc,argv args to include(); changed all
3124 calls to include(); change include() to return 0 or 1 - caller
3125 can check exstat if desired; c_dot() should return 1 if can't open
3128 * c_sh.c(c_brkcont): warning message could call getn() with NULL - save
3129 original number and print it.
3131 * main.c(main): set $0 to first argument when -c used, ie,
3132 "sh -c cmd-string this-is-$0 argumernts..."
3134 * exec.c(iosetup): print "cannot open" if IOHERE fails.
3136 * io.c(errorf): set exstat to 1.
3138 * exec.c(search): assume mode is R_OK or X_OK (not 0/1 - 0 is F_OK, we
3139 want R_OK); changed all calls to pass R_OK/X_OK.
3140 sh.h: define R_OK,W_OK,X_OK,F_OK if not defined.
3141 eaccess(): changed all calls to use [RWXF]_OK.
3143 * sh.h(flag[], shell_flags[], Flag()): Renamed flag[] array to
3144 shell_flags[] to avoid conflicts with other uses of flag; Changed
3145 all references to flag[] to Flag(); defined Flag() to cast its arg
3146 to an int (for old pcc based C compilers).
3148 * vi.c(iswordch): use letnum() instead of isalnum || _.
3150 * misc.c(parse_args): call set_array() to deal with -A flag.
3151 * var.c(set_array): new function.
3154 Fri Jun 3 10:22:26 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
3156 * eval.c(substitute): afree(s).
3158 * var.c(global,local), sh.h: ARRAYMAX: new define - max index of an
3159 array; changed 511 constants to this; changed global() and local()
3160 to use array_ref_len() instead of arraysub().
3162 * expr.c(token): deleted unneeded arraysub() decl.
3164 * lex.c(arraysub), proto.h: made static, removed unused arguments,
3165 changed callers; removed prototype from proto.h.
3167 * ChangeLog: changed descriptions from func(file) to file(func).
3169 Wed Jun 1 09:17:50 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
3171 * made pdksh-4.9+mun.2 distribution
3173 * Makefile.in: added RCSFILES macro and rcs-ci target.
3175 * configure.in: add termio.h to the AC_HAVE_HEADERS() call.
3177 * sh.h, main.c, edit.c, misc.c: use EXTERN for aperm, x_cols,
3178 builtin_optind and builtin_optarg in sh.h, delete definitions
3179 in main.c, edit.c and misc.c.
3181 * io.c(maketemp): changed sizeof(PATH) to sizeof(path).
3183 * aclocal.m4(KSH_VOID,KSH_DUP2_CHECK): test that a void * variable
3184 can be used (Ultrix 2.2 compiler doesn't do this); added ifdef
3185 HAVE_FCNTL_H to dup2 test.
3187 * aclocal.m4, configure.in, sh.h, tree.c, io.c, shf.c: added
3188 new config test KSH_PROTOTYPES to check for function prototypes
3189 (MIPS RICS/os 5.0 C compiler isn't STDC and it can't mix <stddef.h>
3190 with <varargs.h>). Removed stdarg.h test (now redundent). Changed
3191 all varargs functions to use HAVE_PROTOTYPES instead of
3192 HAVE_STDARG_H && STDC.
3194 * eval.c(alt_scan): changed type of endc param from char to int to
3195 avoid problems with mixing prototype declarations and K&R
3198 * main.c(main), sh.h: added plain getcwd() decl to main(), removed
3199 ARGS() version from sh.h (some systems have getcwd() but don't
3200 declare it, some have getcwd() with a size_t arg 2, some have
3203 * misc.c(memset,memmove): changed the second memset() to memmove().
3205 * c_sh.c(clocktos): changed #if CLK_TCK ... to if (CLK_TCK.. since
3206 CLK_TCK is not always defined to a number (may be a _sysconf())).
3208 Tue May 31 10:49:16 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
3210 * configure.in, Makefile.in: added code to set GCC_WARNFLAGS from
3211 $(srcdir)/Warn-flags if gcc is being used; Took -Wall, etc.
3212 out of CFLAGS, took -Dno_RCSids out of DEFS. Added install.sh to
3213 DISTFILES, grabbed copy of install.sh from autoconf (who grabbed
3216 * io.c(errorf,shellf,shprintf),shf.c(shf_fprintf,shf_snprintf),
3217 tree.c(fptreef,snptreef): don't use ansi decls with old style
3218 varargs; changed ifdef __STDC__ to ifdef HAVE_STDARG_H.
3220 * jobs.c(j_init): changed getpgrp() call to getpgID(), defined getpgID()
3221 appropriately for BSD vs POSIX/SYSV getpgrp.
3223 * expand.h, ksh_dir.h, ksh_stat.h, ksh_time.h, ksh_wait.h, shf.h,
3224 tty.h: added RCS $Id: ChangeLog.0,v 1.1 2004/11/20 13:28:11 hnl_dk Exp $'s.
3226 * acconfig.h: updated SIGSET_T comment: unisgned int -> unsigned.
3228 * aclocal.m4(KSH_CLOCK_T,KSH_TIME_T,KSH_SIGSET_T): make sure
3229 type is a word (same fix as was done for more_t, et.al.).
3231 * aclocal.m4(KSH_VOLATILE): check that the compiler can deal with
3232 volatile pointers (dec/pmax ultrix 4.2 compiler can't).
3234 * misc.c(parse_args): added skelatal code for dealing with -A.
3236 * var.c,proto.h(skip_varname): new function; deleted isassign()
3237 function, which is no longer called. Changed typeset(var.c)
3238 to use skip_varname().
3240 * var.c(strint): fail if base is not in the range 2..36; set variable
3241 base according to first base seen; generate an error if a non-alnum
3242 char is seen (1^A was the same as 11).
3244 * var.c(strval): for integer variables, output base if != 10.
3246 * sh.h: fixed typo in x_cols define (#defined -> #define).
3248 Fri May 27 16:49:29 NDT 1994 Micharl Rendell (michael@panda.cs.mun.ca)
3250 * made pdksh-4.9+mun.1 distribution
3252 * finished autoconf'ing source code.
3254 Fri May 20 16:47:06 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
3256 * c_ulimit.c(c_ulimit) (was do_ulimit.c(do_ulimit)): major rework;
3257 deal with combinations of getrusage and ulimit, use options at&t
3259 * misc.c(builtin_getopt): yet another getopt routine for builtin
3261 * misc.c(parse_args), c_sh.c(c_set), main.c(main): custom option
3262 parsing routine for command line/set options. Lots of changes
3263 to main() to incorporate this (easier to follow).
3264 * c_test.c(c_test): added -e (file exists) test.
3266 Fri May 5 12:16:46 NDT 1994 Michael Rendell (michael@panda.cs.mun.ca)
3268 * numerous changes from old Notes.4-9 file:
3270 - calls to errorf identify what function the error is in
3271 (eg, errorf("print: bad -u option");)
3272 - added array stuff (lots of places)
3275 - var.c: +arraysearch(), +basename()
3276 - c_sh.c(c_exit), main.c(shell), sh.h:
3277 - added reallyquit flag to deal with stopped jobs at exit time;
3278 only two exit commands (or eofs) in a row will work. in
3279 shell(), set exstat from execute value.
3281 - handle \\ at end of string better (don't skip the null)
3282 - c_ksh.c(c_whence):
3283 - stop looking as soon as we get a failure
3284 - pass flag[FTRACKALL] to findcom() instead of 0
3286 - print '%s alias not found' if not found
3288 - handle -l option (list pid)
3290 - two column -l output to try to keep it on one screen
3292 - skip IFS at start of line "echo ' a b' |(read a b; echo $a)"
3293 should print a, not nothing.
3294 - changed EOF check to set all vars to null (same way \n is
3297 - after compile(), return if t is NULL
3298 - use setfileno() instead of fileno(x) = .. (see sh.h changes);
3300 - set exstat if redirect fails
3301 - exec.c(fd_clexec):
3302 - check that fd >= 0
3304 - change SHARPBANG ifdef code - everyone uses scriptexec().
3305 ifdef is put around open/read/parse code in scriptexec().
3308 - eaccess test out side of loop: must be regular file to exec it
3311 - added while getc() == 0 in XCOM
3312 [a null in the output of a file would be treated as eof and
3313 waitlast would not be called]
3315 - '%' subst: use ATEMP, not APERM
3316 - eval.c(tilde): use Xinit et. al., instead of fixed length buffer
3317 - getopts.c(getopt): rename getopt() to ksh_getopt() to avoid
3318 problems with prototypes in system #include files.
3320 - call clearerr(fd) if already open
3321 - use F_GETFL to determine appropriate mode for fdopen() call
3322 instead of opening everything for read/write
3323 - use ifdef _FSTDIO instead of ifdef _BSDI (_FSTDIO is used in
3324 4.4bsd, NetBSD, FreeBSD and other non BSDI environs)
3325 - lex.c(ungetsc): don't decrement if str == null, remove nullstr hack
3327 - \ at eol: call Xfree before goto Again
3328 - use memset() to clear ident, instead of while loop
3329 - syn.c(get_command): renamed from command() to get_command() to
3330 avoid conflicts with command(main.c).
3331 - sym.c(get_command):
3332 - allow A=B <alias-name> to work (alias was not being expanded)
3333 - allow `if .. if .. fi fi' to work (no ; after group terminator
3334 (fi , esac, done, ), })
3335 - allow `alias FI=fi ; if .. if .. fi FI' to work (alias
3336 expansion after group terminator)
3337 - do not assume resize returns same pointer
3339 - handle IORDWR case
3340 - added leading quote for file in IOHERE case
3342 - add MAILCHECK check
3344 - add MAILCHECK case (doesn't do anything yet)
3346 - handle null vp->val.s
3347 - eval.c(sh.h, expand), misc.c(options[]):
3348 - enable alternations only if alternations flag set
3349 (set -o alternations). This is so (att ksh) scripts that don't
3350 expect alternations won't break.
3351 - added notify option (asynchronous job completion notification)
3352 - added vicomplete to enable tab char as file name completion
3353 char in vi (this is likely to go away - exits for historical
3355 - jobs.c, main.c, sh.c, trap.c:
3356 - define/use SIG_HDLR instead of void
3357 - eval.c(expand): alt_expand() does not return a value so don't test
3358 it, just return. Also changed decl of alt_expand() to reflect
3360 - emacs.c(x_emacs): first return returns random value (i); change to
3361 return 0. Also changed the way interrupts are returned to called
3362 (return -2 means interrupt).
3363 - c_sh.c(c_brkcont): at&t ksh allows breaks/continues outside of
3364 loops, 4.9 prints an error and breaks out of all env's (if, case,
3365 etc.). Fixed to act like at&t (ie, allow bogus continues), except
3366 a warning message is printed. (Some HP-UX shell scripts actually
3367 have continues outside of loops...)
3368 - main.c(shell): parameter s should be volatile as it is used after a
3370 - edit.c(promptlen): handle tabs, backspaces...
3371 - cleaner fix to the ^C/source->line problem: in pprompt(lex.c),
3372 convert ! to source->line+1 (same in promptlen(edit.c)), increment
3373 source->line after a (non-empty, non-eof) line has been read
3374 (before call to histsave()). To be pedantic, also adjust
3375 position of source->line++ in SHIST in case PS9 is ever used.
3376 Remove code in shell(main.c) that does the source->line--,
3377 remove the source->line-- for eof and empty line in from
3379 - trap.c(sigtrap[]): do not depend on signal number matching position
3380 in initialization array. Use second table in which order does not
3381 matter to initialize sigtrap[] array. Easier to read/port, and
3382 generally less fragile. requires call to inittraps() in main.c.
3383 - trap.c(cleartraps): need to clear Sigact flags/mask after use
3384 (actually, declare a local struct sigact and use that instead of
3386 - exec.c(execute): case TSELECT: no USE_SIGACT code for call to
3387 signal(); case TPIPE: don't call waitlast() if XXCOM since
3388 waitlast() will be called in expand(); 4.9 code that set and
3389 then cleared the XEXEC flag in the TPIPE case not added since
3390 it was ifdef'd out, also the code to not exit if XPIPEI flag
3391 set was not added; 4.9 XXWHL flag not added (don't flush stdin
3392 if in a while loop) since this problem fixed (I hope) by shf stuff.
3393 - ttyfd{sh.h/lex.c}: use EXTERN/_I_ to initialize ttyfd. Remove from
3395 - interrupted reads: instead of testing sigchld_caught after reads
3396 fail, continue them if errno == EINTR.
3397 - edit.c(x_getc): check for EINTR, and continue reading if so.
3398 - lex.c(getsc_): check for EINTR, and continue reading if so.
3399 (don't check return of x_read() - check has already been done)
3400 - exec.c(selread): check for EINTR, and continue reading if so.
3403 - histrpl(): bounds check doesn't take global flag into
3404 account - move check into loop and past loop.
3405 - c_fc(): if pattern is the empty string, histrpl()
3406 goes into infinate loop. Start searching for = after first
3407 char (this is what at&t ksh seems to do).
3408 - c_fc(): `fc -l first' should list at most 16
3409 commands according to at&t manual.
3410 - findhist(): re-wrote: shorter, easier to follow. Now
3411 returns an int. (used only by vi code)
3412 - use COMPLEX_HISTORY's allocated history array in
3413 EASY_HISTORY: common init_histvec(), sethistfile() and
3414 sethistsize() functions.
3415 In the process, hist_open() went away. Use histsize
3416 instead of HISTORY in hist_init() and hist_finish()
3417 #ifdefs in lex.h, table.h,
3418 var.c disappear, history variable definitions in lex.c
3420 - hist_init(COMPLEX_HISTORY): move hstarted = 1 to after the
3422 - hist_finish(): don't open hname if its null
3423 - histrpl(): made static, use ARGS in decl
3424 - made current and curpos static
3425 - changes to allow embedded newlines in commands:
3426 - histsave(): trash only trailing newline
3427 - hist_init(): read in null terminated lines instead of
3429 - hist_finish(): write null terminated lines
3430 - make multiple line command appear in single history line
3431 (EASY_HISTORY only):
3432 - added histappend() to append new command to last
3434 - added call to histappend() in getsc_(lex.c) (also: only
3435 adjust source->line if not multiline).
3437 - remove second decl of history if !EASY_HISTORY
3438 - tree.c(ptree): case TCOM: check if t->vars or t->args is 0
3439 - vi.c(x_vi): ^D anywhere in command line is eof ($ foobar^D exits).
3440 at&t ksh ignores ^D in middle of line
3442 - don't need to include string.h - included in stdh.h
3443 - init_editmode(): in at&t ksh, VISUAL takes precenence over
3444 EDITOR, so put it first. Also, at&t ksh doesn't use FCEDIT so
3446 - moved initialization of ed_* from x_read() to x_init() since
3447 thats where they are set from tty structs.
3448 - x_init(): set ed_intrc, ed_quitc for _BSD & _POSIX_TERM ifdefs
3449 - send output to shlout (instead of stdout - at&t ksh writes to
3451 - made x_do_init static.
3452 - exit.c(x_getc), lex.c(yylex): restart interrupted reads in
3453 x_getc(), changed read-restart in yylex() to only effect call
3455 - syn.c(thenpart): then THEN is not optional - generate a syntax
3456 error if no THEN. (ie, `if true ; fi' is not legal).
3457 - syn.c(get_command): don't accept keywords after re-directory (eg,
3458 `> /dev/null if true ; then echo hi ; fi' is not legal).
3459 - vi.c: handle \ and ^[ in command mode ala at&t ksh (filename
3461 - syn.c(thenpart), syn.c(elsepart): calling token(0) when they want a
3462 keyword (always worked 'cause tpeek() is always called before, with
3463 the keyword flag). Fix: call token(KEYWORD|ALIAS) (at&t ksh does
3464 alias expansion here). Question: pass CONTIN as well?
3465 - syn.c(get_command): LWORD/MPAREN case: do alias expansion when
3466 getting open brace ({). CASE case: ditto for `in' and `esac'.
3467 IF case: ditto for `fi'. FUNCTION case: dito for open brace ({).
3468 - syn.c(dogroup): alias expansion when getting `do' and `done'.
3469 - syn.c(wordlist): alias expansion when getting `in'.
3470 - syn.c(nested): alias expansion when getting `)', `}'
3471 - syn.c(casepart): alias expansion when getting `esac' or `;;'.
3472 Also removed use of cf variable - it does nothing.
3473 - eval.c(expand): case CSUBST: '#'/'%' - increment st so nested
3475 - var.c(typeset): INTEGER && no assignment: memory was being freed
3476 and then used (there was even a comment saying it was being
3478 - lex.c, lex.h, exec.c, main.c:
3479 added shf_{open,fdopen,close,gets}() routines so stdio wasn't
3480 used. When reading a command file under osf/1, stdio would
3481 mess up the read pointer when a child exited: the exit flushed
3482 all open files and flushing a file open for reading changes the
3483 current read position (does a seek to where the next char would
3484 be read). This position is then used by the parent process,
3485 who thinks the read position is still at the end of the buffer
3488 use shf_*() routines avoids two bugs in read:
3489 - on sunos 4.1.3, a read would gobble up a stdio buffer and
3490 never put it back (ie, lseek backwards). Neither a
3491 fflush() nor a fseek(x, 0L, 1) fixed the problem.
3493 - on linux, stdio knows its current offset and seeks there
3494 before reading a buffer. This causes grief when the shell
3495 replaces file descriptors behind stdio's back (ie, all the
3500 $ cat > /dev/tty << EOF
3501 1:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
3502 2:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
3503 3:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
3506 the cat picks up reading at the offset where the read
3507 command left off (ie, at bcdefg... - the 1:a are skipped).
3508 - exec.c(comexec): built-in c_exec && no args: close the saved fd's
3509 (were thrown away). Also, set close-on-exec flag for fd's > 2,
3511 - lex.c(yylex): only accept 1 digit before a redirection (eg, 1> is
3513 - exec.c(iosetup): only accept 1 digit after a dup-redirection
3514 (eg, >&1 is ok, >&1abc is not)
3515 - exec.c(iosetup): use O_APPEND flag for >> redirections; use O_CREAT
3516 flag for <> redirections. (re-organized to accumulate open() flags
3517 and do one open() call); changed error message to know about dup
3519 - c_sh.c(c_umask): umask should have leading 0 - doesn't when umask
3520 has 3 digits (eg, `umask 222; umask' prints 222 instead of 0222)
3521 - c_sh.c(setsig): declare local struct sigaction and use it so
3522 sa_flags doesn't have to be cleared (also to try to keep away from
3525 - don't go set TALKING if name starts with -.
3526 - read $HOME/.profile (not .profile)
3527 - main.c(main): re-wrote option parsing code
3528 - edit.c(init_editmode): don't check FCEDIT
3529 - if set -o vi/emacs/gmacs on command line, don't set edit mode from
3531 - var.c(setspec): FCEDIT should not magicly change edit mode; VISUAL
3532 and EDITOR should (EDITOR only if VISUAL is not set)
3533 - changed noclobber char from ! to | (this is what at&t ksh uses)
3534 - exec.c(iosetup): use O_EXCL flag if FNOCLOBBER set and >| not used
3535 - c_sh.c(c_set): don't clear FERREXIT if FTALKING is set; although
3536 some ksh manuals say -e is ignored for interactive shells, they
3537 all seem to honour the -e flag for interactive shells.
3538 - vi.c: reset history position to the end after a line is modified
3539 - `(( 1 + 2 ))' no longer prints `+: bad expression'!
3540 - lex.c(yylex): added parenthesis counting so `(( ((1+2)) ))' no
3541 longer generates a syntax error
3542 - expr.c(intvar): if strint() fails, give bad number error
3543 (`let 1+foo' should fail)
3544 - `echo hi 1abc123> /dev/tty' no longer interpreted as
3545 `echo hi 1> /dev/tty' (is `echo hi 1abc123 > /dev/tty')
3546 - `echo hi 1<> /tmp/does-not-exist' now works (used to say cannot
3548 - c_sh.c(c_umask): umask now takes symbolic arguments (g-r, +w, etc.)
3549 - c_ksh.c(c_whence): pass flag[FTRACKALL] to findcom() instead of 1.
3550 - `echo hi >< bar' now produces an error
3551 - jobs.c(j_lookup): now checks for ambiguous job specifications;
3552 callers now get an error message.
3553 - c_ksh.c(c_fgbg): multiple jobs can be specified
3554 - emacs.c(x_transpose): move past transposed chars like (gnu) emacs
3556 - main.c(main): don't copy initcoms (messes up memory allocated for
3557 shf_iob[] in initio(), should not be necessary)
3558 - main.c(main), var.c(import), var.c(typeset), c_ksh.c(c_alias),
3559 expr.c(token), misc.c(strnsave): added strnsave() function; use it
3560 instead of writing nulls in the middle of strings; main() no longer
3561 copies startup commands before executing them.
3562 - vi.c: wbuf[] no longer a fixed size (was hard coded to 80 chars).
3563 - alloc.c(aresize): if passed a null pointer, don't free it
3564 - expand.h: restored usage description and NOTE from previous version
3565 - alloc.c, table.h, table.c:
3566 - changed struct fields named `free' to nfree (struct table) and
3567 freelist (struct Block) to allow memory debugging
3568 (involves #defining free)
3569 - main.c(main): smart initialization of PWD (ensures it is always
3571 - lex.h, table.h, tree.h: removed redundent function declarations
3572 (were also in proto.h)
3573 - sh.h: increased LINE from 256 to 1024
3574 - main.c(include), sh.h(E_INC), c_sh.c(c_return): added hack so a
3575 return in a included file returns to the includer instead of
3576 exiting the shell. Very useful in $ENV scripts and profiles,
3577 eg, so the whole script does not have to be parsed for
3578 non-interactive shells.
3579 This is not compatible with the at&t ksh, whose man page says
3580 return is the same as exit outside of functions. May be modified
3581 in the future. (note that at&t ksh parses a .'ed file before
3582 executing anything, so a premature return would not speed its
3583 parsing, which is why the return hack was added to pdksh)
3584 - exec.c(iosetup): don't save fd if already saved (and don't
3586 - exec.c(findcom): in if (..ALLOC && eaccess), test for
3587 ALLOC redundent - always call afree()