Commit Graph

8 Commits

Author SHA1 Message Date
tribby
05d82736bc Changes for gsh version 2.0d10:
Add check for buffer overflow when globbing, expanding variables, or
inserting aliases (PR#110).  Increase buffer size from 1024 to 4096.

Increase buffer for reading commands from 256 to 1024 bytes in order
to match the maximum length used when reading.
1999-02-08 17:26:51 +00:00
tribby
6269a8ca25 Changes for gsh version 2.0d8:
Fixed several mutual exclusion problems, including a particularly nasty
one that would cause gsh to loop forever inside the memory manager. (You
could identify this one by the "BRA (-23)" at the bottom of the infinite
loop.)

Fixed the string vector print routine to properly handle all numbers of
entries in the hash table.  Previously, it would always print duplicate
entries if there were < 6 commands hashed, and would sometimes print
duplicates (depending on previous contents of an internal table) for
other numbers of commands.

gsh would wait on background processes started from an exec file
(executed, not sourced). Now the exec file does not wait on the process,
but the background process is not associated with the parent shell after
the exec file terminates.

Made gsh globbing work more like csh: if none of the requested patterns
are found, print "No match" and exit.

At startup, if /etc/glogin, $HOME/glogin, or $HOME/gshrc does not exist,
don't report a "file not found" error message. (PR#100)
1998-12-31 18:29:14 +00:00
tribby
1dc5497309 Added startup protocol as requested by Devin Reed (PR#78) and Steve Reeves
(PR#85, PR#86):
   For login shells (command line starts with '-'),
	If $PATH doesn't start with ':' or contain a space,
	   change all ":" to " ".
	source /etc/glogin
	source $HOME/glogin
$HOME/gshrc is sourced afterward for both login and non-login shells.

Don't the print number of hashed commands (from "rehash") until all
initialization is completed.

Only pass exported environment variables to child processes, and prevent child
processes from changing parent's environment.

A null command followed by a redirection of stdout, for example
  > /tmp/list
would cause an error message "<garbage> not found" due to incorrect
setting of command buffer pointer.

Filename completion did not work following ">&" or ">" without a trailing
space.

Entabbed all the asm files, saving more than 36,000 bytes.
1998-09-08 16:53:14 +00:00
tribby
2e0ebb5392 Replaced last of old shell calls with their newer counterparts. This
removed the need for p-string routines, so they were removed. Also
removed alloc256/free256 and associated data structures.

In removing calls, found instances in pwd & prefix commands and prompt
handler where current directory name was assumed to be < 256 characters;
recoded to use a flexible buffer size.

Updated and expanded mmdebug.asm routines that perform error checking on
memory management calls. Added macros ~NEW and ~DISPOSE that invoke either
the real or debug routines.

Fixed call to read $TERM variable's length to fix PR#81.

Removed echo of data when setting value of $< in expandvars (expand.asm).
The characters are echoed as they are typed and do not need to be reprinted
on stdout after carriage-return is typed.

Added error checking to the various flavors of prefix (just like cd):
  - Verify 2nd parameter is a valid directory before setting.
  - Verify 1st parameter < 32 before displaying or setting.
1998-08-03 17:30:30 +00:00
tribby
d534981038 Changed many invocations from old shell interface routines (Read_Variable,
Set_Variable, Export, etc.) to new ones (ReadVariableGS, SetGS, ExportGS,
etc.) in many places; there are still a few more to change.  This change
removed the 256-character limit on strings retrieved by these routines,
such as the value of environment variables. (PR # 9).

At startup do not set $TERM to gnocon if it is already set.

Removed the df command (from builtin.asm).

Defined macro incad to increment a 4-byte address, checking for overflow;
replaced instances of "inc ptr" with "incad ptr".

Changed column offset table to use a 1-word rather than 1-byte entry. This
resolves PR#14 (hash wouldn't print beyond first 256 filenames).

Fixed defect in unalias (alias.asm) where the double quote portion of the
scanner would look for a terminating single quote. This resolves PR#69.

Changed default order for copying files in $PATH dirs into executable list,
so earlier paths files are found first.

Added environment variable flag $OLDPATHMODE to make gsh behave in the old
(backwards order) way when necessary.

Discard duplicate filenames when hashing.

Fix PR#73: directory in $PATH with escaped space (\ ) is not searched.
1998-07-20 16:23:11 +00:00
tribby
01902c1b91 Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
   of expanded $HOME match the user's delimiter.

 * When wildcard patterns don't match, rather than terminating the command
   gsh now prints "No match: <pattern> ignored" and passes the command line
   minus the unmatched patterns on to be executed.

 * Modified echo command so it doesn't add a blank to the end.

 * Make "clear" and "source" built-ins non-forked commands.  Unforking
   "source" allows prefixes to be set in files that are sourced.

 * Add loop to parse a single command (removing leading whitespace) before
   sending it off to be expanded and executed. Skip null lines and comments
   at this level. This allows later commands that depend upon variables set
   in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
   Also fixes problems seen when tab was first character of multiple lines.

 * Initialize environment variable flags at startup (for echo, nodirexec,
   nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
   flag when env var is set in upper or lower case (formerly, only worked
   with lower case).

 * Lots of places two-word addresses are incremented using inc, without
   checking for overflow into the high-order word. As these are discovered,
   they are changed to use adc on both words.


See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
gdr-ftp
61474a874f This checkin contains only enough changes that gsh is able to assemble
and link.  However, it does not work yet and thus still needs work.

The *.asm files have had the following common changes:
	- 'keep' lines were eliminated
	- the 'mcopy' now takes the macro from the /obj/gno/bin/gsh
	  directory.  This is in anticipation of having the macro
	  files generated from a single source file; there is a large
	  amount of duplication.  For the moment, the makefile merely
	  copies the old macro files from the "M" directory to the
	  /obj/gno/bin/gsh directory.
	- start each file with a dummy routine so that the source
	  code winds up in the *.o rather than the *.root file.
	- added the 'setcom 60' directive; there were many source
	  lines that were otherwise getting truncated.

The makefile is a complete rewrite.
1998-04-24 15:38:47 +00:00
gdr
1f1b3ada37 Initial checkin of gsh v1.1 as provided by Tony Diaz. 1997-11-18 05:31:00 +00:00