1998-08-03 17:30:30 +00:00
|
|
|
**************************************************************************
|
1997-11-18 05:31:00 +00:00
|
|
|
*
|
|
|
|
* The GNO Shell Project
|
|
|
|
*
|
|
|
|
* Developed by:
|
|
|
|
* Jawaid Bazyar
|
|
|
|
* Tim Meekins
|
|
|
|
*
|
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
|
|
|
* $Id: expand.asm,v 1.7 1998/12/31 18:29:13 tribby Exp $
|
1998-04-24 15:38:47 +00:00
|
|
|
*
|
1997-11-18 05:31:00 +00:00
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* EXPAND.ASM
|
|
|
|
* By Tim Meekins
|
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
|
|
|
* Modified by Dave Tribby for GNO 2.0.6
|
1997-11-18 05:31:00 +00:00
|
|
|
*
|
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
|
|
|
* Command line expansion routines for wildcards and env vars
|
1997-11-18 05:31:00 +00:00
|
|
|
*
|
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
|
|
|
* Note: text set up for tabs at col 16, 22, 41, 49, 57, 65
|
|
|
|
* | | | | | |
|
|
|
|
* ^ ^ ^ ^ ^ ^
|
1997-11-18 05:31:00 +00:00
|
|
|
**************************************************************************
|
|
|
|
|
1998-04-24 15:38:47 +00:00
|
|
|
mcopy /obj/gno/bin/gsh/expand.mac
|
|
|
|
|
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
|
|
|
dummyexpand start ; ends up in .root
|
1998-04-24 15:38:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
setcom 60
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
**************************************************************************
|
|
|
|
*
|
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
|
|
|
* glob the command line and expand filename wildcard characters
|
1997-11-18 05:31:00 +00:00
|
|
|
*
|
|
|
|
**************************************************************************
|
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
glob START
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
using vardata
|
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
count equ 0
|
|
|
|
gname equ count+2
|
|
|
|
sepptr equ gname+4
|
|
|
|
eptr equ sepptr+4
|
|
|
|
exppath equ eptr+4
|
|
|
|
filesep equ exppath+4
|
|
|
|
shallweglob equ filesep+2
|
|
|
|
wordbuf equ shallweglob+2
|
|
|
|
ptr equ wordbuf+4
|
|
|
|
buf equ ptr+4
|
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
|
|
|
globflag equ buf+4
|
|
|
|
space equ globflag+2
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
subroutine (4:cmd),space
|
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
|
|
|
|
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
|
|
|
; Allocate buffer to hold result
|
1998-09-08 16:53:14 +00:00
|
|
|
jsl alloc1024
|
|
|
|
sta buf
|
|
|
|
stx buf+2
|
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
|
|
|
|
|
|
|
; Check for noglob variable and exit if it's set to something.
|
|
|
|
ldy varnoglob
|
|
|
|
beq doglob
|
|
|
|
|
|
|
|
; Allocate a buffer, copy the command line into it, and return.
|
1998-09-08 16:53:14 +00:00
|
|
|
pei (cmd+2)
|
|
|
|
pei (cmd)
|
|
|
|
pei (buf+2)
|
|
|
|
pei (buf)
|
|
|
|
jsr copycstr
|
|
|
|
jmp bye
|
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
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
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
|
|
|
; noglob isn't set, so we can start globbing.
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
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
|
|
|
doglob sta ptr ptr points to next
|
1998-08-03 17:30:30 +00:00
|
|
|
stx ptr+2 position in buf.
|
|
|
|
|
|
|
|
jsl alloc1024 Create a word buffer.
|
|
|
|
sta wordbuf
|
|
|
|
stx wordbuf+2
|
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
|
|
|
|
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
|
|
|
stz globflag globflag = no globbing done (yet).
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
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
|
|
|
; Find the beginning of the next word
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
findword jsr g_getbyte Get character from command line.
|
|
|
|
jeq alldone
|
|
|
|
if2 @a,eq,#' ',passthru
|
|
|
|
if2 @a,eq,#009,passthru
|
|
|
|
if2 @a,eq,#013,passthru
|
|
|
|
if2 @a,eq,#010,passthru
|
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
|
|
|
if2 @a,eq,#';',passthru
|
|
|
|
if2 @a,eq,#'&',passthru
|
|
|
|
if2 @a,eq,#'|',passthru
|
|
|
|
if2 @a,eq,#'>',passthru
|
|
|
|
if2 @a,eq,#'<',passthru
|
|
|
|
|
|
|
|
; It's not a simple pass-through character. See what needs to happen.
|
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
stz shallweglob
|
|
|
|
ldy #0
|
|
|
|
bra grabbingword
|
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
|
|
|
|
|
|
|
; For pass-through characters, just copy to output buffer.
|
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
passthru jsr g_putbyte
|
|
|
|
bra findword
|
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
|
|
|
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
|
|
|
; single out the next word [y is initialized above]
|
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
grabword jsr g_getbyte
|
|
|
|
grabbingword if2 @a,eq,#"'",grabsingle
|
|
|
|
if2 @a,eq,#'"',grabdouble
|
|
|
|
if2 @a,eq,#'\',grabslash
|
|
|
|
if2 @a,eq,#' ',procword
|
|
|
|
if2 @a,eq,#009,procword
|
|
|
|
if2 @a,eq,#013,procword
|
|
|
|
if2 @a,eq,#010,procword
|
|
|
|
if2 @a,eq,#000,procword
|
1997-11-18 05:31:00 +00:00
|
|
|
if2 @a,eq,#';',procword
|
|
|
|
if2 @a,eq,#'&',procword
|
|
|
|
if2 @a,eq,#'|',procword
|
|
|
|
if2 @a,eq,#'>',procword
|
|
|
|
if2 @a,eq,#'<',procword
|
1998-09-08 16:53:14 +00:00
|
|
|
if2 @a,eq,#'[',grabglob
|
|
|
|
if2 @a,eq,#']',grabglob
|
|
|
|
if2 @a,eq,#'*',grabglob
|
|
|
|
if2 @a,eq,#'?',grabglob
|
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
|
|
|
|
|
|
|
; Default action (also completion of some of the other special cases)
|
1998-09-08 16:53:14 +00:00
|
|
|
grabnext sta [wordbuf],y Save character in word buffer
|
|
|
|
iny and bump its index.
|
|
|
|
bra grabword Get next character of word.
|
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
|
|
|
|
|
|
|
; "[", "]", "*", "?"
|
1998-09-08 16:53:14 +00:00
|
|
|
grabglob ldx #1 Set "shallweglob"
|
|
|
|
stx shallweglob flag.
|
|
|
|
bra grabnext Store char in word buf & get next.
|
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
|
|
|
|
|
|
|
; "\"
|
1998-09-08 16:53:14 +00:00
|
|
|
grabslash sta [wordbuf],y Save "\" in word buffer
|
|
|
|
iny and bump its index.
|
|
|
|
jsr g_getbyte Get next character in cmd line.
|
|
|
|
beq procword If null byte, word is terminated.
|
|
|
|
bra grabnext Store char in word buf & get next.
|
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
|
|
|
|
|
|
|
; '"'
|
1998-09-08 16:53:14 +00:00
|
|
|
grabsingle sta [wordbuf],y Save char in word buffer
|
|
|
|
iny and bump its index.
|
|
|
|
jsr g_getbyte Get next character in cmd line.
|
|
|
|
beq procword If null byte, word is terminated.
|
|
|
|
if2 @a,eq,#"'",grabnext If "'", store and grab next char.
|
|
|
|
bra grabsingle Save new char and stay in this loop.
|
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
|
|
|
|
|
|
|
; "'"
|
1998-09-08 16:53:14 +00:00
|
|
|
grabdouble sta [wordbuf],y Save char in word buffer
|
|
|
|
iny and bump its index.
|
|
|
|
jsr g_getbyte Get next character in cmd line.
|
|
|
|
beq procword If null byte, word is terminated.
|
|
|
|
if2 @a,eq,#'"',grabnext If '"', store and grab next char.
|
|
|
|
bra grabdouble Save new char and stay in this loop.
|
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
|
|
|
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
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
|
|
|
; The complete word is in the buffer. Time to process it.
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
procword dec cmd Decrement cmd line pointer.
|
|
|
|
lda #0 Terminate word buffer with
|
|
|
|
sta [wordbuf],y a null byte.
|
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
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
|
|
|
; Shall we glob? Shall we scream? What happened, to our postwar dream?
|
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
lda [wordbuf]
|
|
|
|
and #$FF
|
|
|
|
if2 @a,eq,#'-',skipdeglob ;This allows '-?' option.
|
|
|
|
lda shallweglob
|
|
|
|
bne globword
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
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
|
|
|
; we didn't glob this word, so copy the word buffer to the output buffer
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
skipdeglob ldy #0
|
|
|
|
flushloop lda [wordbuf],y
|
|
|
|
and #$FF
|
|
|
|
beq doneflush
|
|
|
|
jsr g_putbyte
|
|
|
|
iny
|
|
|
|
bra flushloop
|
|
|
|
doneflush jmp findword
|
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
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
|
|
|
; Hello, boys and goils, velcome to Tim's Magik Shoppe
|
|
|
|
;
|
|
|
|
; Ok, here's the plan:
|
1998-08-03 17:30:30 +00:00
|
|
|
; 1. We give InitWildcardGS a PATHNAME.
|
|
|
|
; 2. NextWildcardGS returns a FILENAME.
|
1997-11-18 05:31:00 +00:00
|
|
|
; 3. We need to expand to the command-line the full pathname.
|
|
|
|
; 4. Therefore, we must put aside the prefix, and cat each file returned
|
1998-08-03 17:30:30 +00:00
|
|
|
; from NextWildcardGS to the saved prefix, but, we must still pass
|
|
|
|
; the entire path to InitWildcardGS.
|
1997-11-18 05:31:00 +00:00
|
|
|
; 5. This solves our problem with quoting. Expand the quotes before
|
1998-08-03 17:30:30 +00:00
|
|
|
; passing along to InitWildcardGS, BUT the saved prefix we saved to cat
|
1997-11-18 05:31:00 +00:00
|
|
|
; to will still have the quotes in it, so that the tokenizer can deal
|
|
|
|
; with it. Whew!
|
|
|
|
;
|
|
|
|
; Well, here goes nuthin'.... [Ya know, and I'm reading Levy's book
|
|
|
|
; 'Hackers' right now...]
|
|
|
|
;
|
|
|
|
;
|
|
|
|
;
|
|
|
|
; Expand out the quoted stuff, and keep an eye out for that ubiquitous last
|
|
|
|
; filename separator... then we can isolate him!
|
|
|
|
;
|
1998-08-03 17:30:30 +00:00
|
|
|
globword stz filesep
|
|
|
|
jsl alloc1024 Alloc buffer for wildcard pattern.
|
|
|
|
sta exppath
|
|
|
|
stx exppath+2
|
|
|
|
|
|
|
|
incad @xa Leave room for length word
|
|
|
|
incad @xa
|
|
|
|
sta eptr
|
|
|
|
stx eptr+2
|
|
|
|
sta sepptr
|
|
|
|
stx sepptr+2
|
1998-09-08 16:53:14 +00:00
|
|
|
|
|
|
|
ldy #0
|
|
|
|
exploop lda [wordbuf],y
|
|
|
|
and #$FF
|
|
|
|
beq endexp
|
|
|
|
iny
|
|
|
|
if2 @a,eq,#'\',expslash
|
|
|
|
if2 @a,eq,#"'",expsingle
|
|
|
|
if2 @a,eq,#'"',expdouble
|
|
|
|
if2 @a,eq,#'/',expsep
|
|
|
|
if2 @a,eq,#':',expsep
|
|
|
|
expput sta [eptr]
|
|
|
|
incad eptr
|
|
|
|
bra exploop
|
|
|
|
expsep sty filesep
|
|
|
|
sta [eptr]
|
|
|
|
incad eptr
|
|
|
|
mv4 eptr,sepptr
|
|
|
|
bra exploop
|
|
|
|
expslash lda [wordbuf],y
|
|
|
|
iny
|
|
|
|
and #$FF
|
|
|
|
beq endexp
|
|
|
|
bra expput
|
|
|
|
expsingle lda [wordbuf],y
|
|
|
|
iny
|
|
|
|
and #$FF
|
|
|
|
beq endexp
|
|
|
|
if2 @a,eq,#"'",exploop
|
|
|
|
sta [eptr]
|
|
|
|
incad eptr
|
|
|
|
bra expsingle
|
|
|
|
expdouble lda [wordbuf],y
|
|
|
|
iny
|
|
|
|
and #$FF
|
|
|
|
beq endexp
|
|
|
|
if2 @a,eq,#'"',exploop
|
|
|
|
sta [eptr]
|
|
|
|
incad eptr
|
|
|
|
bra expdouble
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
|
|
|
; We really didn't mean to expand the filename, so, copy it back again..
|
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
endexp ldy filesep
|
|
|
|
copyback lda [wordbuf],y
|
|
|
|
iny
|
|
|
|
and #$FF
|
|
|
|
sta [sepptr]
|
|
|
|
incad sepptr
|
|
|
|
cmp #0
|
|
|
|
bne copyback
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-08-03 17:30:30 +00:00
|
|
|
; Calculate length by subtracting sepptr from starting address
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
sub2 sepptr,exppath,@a
|
|
|
|
dec2 a Don't count length word or \0
|
1998-08-03 17:30:30 +00:00
|
|
|
dec a
|
1998-09-08 16:53:14 +00:00
|
|
|
sta [exppath]
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-08-03 17:30:30 +00:00
|
|
|
; We now have enough to call InitWildCardGS!!!
|
|
|
|
; [ let's mutex the rest so we don't have to fix InitWC and NextWC ;-) ]
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
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
|
|
|
lock glob_mutex
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-08-03 17:30:30 +00:00
|
|
|
; Call shell routine InitWildcardGS to initialize the filename pattern
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-08-03 17:30:30 +00:00
|
|
|
stz count
|
|
|
|
mv4 exppath,initWCpath
|
|
|
|
InitWildcardGS initWCparm
|
|
|
|
|
|
|
|
ph4 #65 Allocate memory for
|
1998-09-08 16:53:14 +00:00
|
|
|
~NEW expanded name.
|
1998-08-03 17:30:30 +00:00
|
|
|
sta gname Store in direct
|
|
|
|
stx gname+2 page pointer
|
|
|
|
sta nWCname and in NextWildcardGS
|
|
|
|
stx nWCname+2 parameter block.
|
|
|
|
lda #65 Store maximum length at
|
|
|
|
sta [gname] beginning of result buf.
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-08-03 17:30:30 +00:00
|
|
|
; Call shell routine NextWildcardGS to get the next name that matches.
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
WCloop NextWildcardGS nWCparm
|
1998-08-03 17:30:30 +00:00
|
|
|
ldy #2
|
|
|
|
lda [gname],y
|
|
|
|
beq nomore
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
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
|
|
|
; Keep count of how many paths are expanded
|
|
|
|
;
|
1998-08-03 17:30:30 +00:00
|
|
|
inc count
|
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
|
|
|
|
|
|
|
;
|
|
|
|
; Copy the original path (up to file separator) to output buffer
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-08-03 17:30:30 +00:00
|
|
|
ldy #0
|
|
|
|
outtahere if2 @y,eq,filesep,globout
|
|
|
|
lda [wordbuf],y
|
|
|
|
jsr g_putspecial
|
|
|
|
iny
|
|
|
|
bra outtahere
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
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
|
|
|
; Copy the expanded filename to output buffer
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-08-03 17:30:30 +00:00
|
|
|
globout ldy #2 Get returned length
|
|
|
|
lda [gname],y from GS/OS buffer.
|
|
|
|
tax
|
|
|
|
ldy #4
|
|
|
|
globoutta lda [gname],y Copy next character
|
|
|
|
jsr g_putspecial into buffer.
|
|
|
|
iny
|
|
|
|
dex
|
|
|
|
bne globoutta
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
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
|
|
|
; Place blank as separator after name and see if more are expanded.
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
lda #' '
|
|
|
|
jsr g_putbyte
|
|
|
|
bra WCloop
|
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
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
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
|
|
|
; All of the names (if any) from this pattern have been expanded.
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
nomore anop
|
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
|
|
|
|
1998-08-03 17:30:30 +00:00
|
|
|
unlock glob_mutex
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
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
|
|
|
; Deallocate path buffers (we should probably alloc once, not each word... )
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
pei (gname+2)
|
|
|
|
pei (gname)
|
|
|
|
jsl nullfree
|
|
|
|
ldx exppath+2
|
|
|
|
lda exppath
|
|
|
|
jsl free1024
|
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
|
|
|
|
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
|
|
|
lda count If something was expanded,
|
|
|
|
beq nothingfound
|
|
|
|
|
|
|
|
lda globflag Set "globbed, something found"
|
|
|
|
ora #$8000 bit in globflag.
|
|
|
|
sta globflag
|
|
|
|
jmp findword Go find the next word.
|
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
|
|
|
|
|
|
|
; Nothing was expanded from the wildcard. If we wanted to act like
|
|
|
|
; ksh, we could pass the original text by doing a "jmp skipdeglob".
|
|
|
|
|
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
|
|
|
nothingfound anop
|
|
|
|
lda globflag Set "globbed, nothing found"
|
|
|
|
ora #$4000 bit in globflag.
|
|
|
|
sta globflag
|
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
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
jmp findword Go find the next word.
|
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
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
|
|
|
; Goodbye, cruel world, I'm leaving you today, Goodbye, goodbye.
|
|
|
|
;
|
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
|
|
|
alldone jsr g_putbyte Store null byte at end of string.
|
|
|
|
|
|
|
|
;
|
|
|
|
; Check globflag for no valid matches found in any pattern
|
|
|
|
;
|
|
|
|
lda globflag
|
|
|
|
cmp #$4000
|
|
|
|
bne alldone2
|
|
|
|
|
|
|
|
ldx #^nomatch
|
|
|
|
lda #nomatch
|
|
|
|
jsr errputs
|
|
|
|
|
|
|
|
ldx buf+2
|
|
|
|
lda buf
|
|
|
|
jsl free1024
|
|
|
|
|
|
|
|
stz buf+2
|
|
|
|
stz buf
|
|
|
|
|
|
|
|
alldone2 ldx wordbuf+2
|
1998-09-08 16:53:14 +00:00
|
|
|
lda wordbuf
|
|
|
|
jsl free1024
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
bye return 4:buf
|
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
|
|
|
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
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
|
|
|
; Subroutine of glob: get a byte from the original command-line
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
g_getbyte lda [cmd]
|
|
|
|
incad cmd
|
|
|
|
and #$FF
|
|
|
|
rts
|
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
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
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
|
|
|
; Subroutine of glob: put special characters. Same as g_putbyte, but
|
|
|
|
; if it is a special shell character then quote it.
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
g_putspecial and #$7F
|
1997-11-18 05:31:00 +00:00
|
|
|
if2 @a,eq,#' ',special
|
|
|
|
if2 @a,eq,#'.',special
|
|
|
|
if2 @a,eq,#013,special
|
|
|
|
if2 @a,eq,#009,special
|
|
|
|
if2 @a,eq,#';',special
|
|
|
|
if2 @a,eq,#'&',special
|
|
|
|
if2 @a,eq,#'<',special
|
|
|
|
if2 @a,eq,#'>',special
|
|
|
|
if2 @a,eq,#'|',special
|
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
|
|
|
bra g_putbyte
|
1997-11-18 05:31:00 +00:00
|
|
|
special pha
|
|
|
|
lda #'\'
|
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
|
|
|
jsr g_putbyte
|
|
|
|
pla ; fall through to g_putbyte...
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
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
|
|
|
; Subroutine of glob: store a byte into the new command-line
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-07-20 16:23:11 +00:00
|
|
|
g_putbyte short a
|
|
|
|
sta [ptr]
|
|
|
|
long a
|
|
|
|
incad ptr
|
|
|
|
rts
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
|
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
|
|
|
glob_mutex key
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-08-03 17:30:30 +00:00
|
|
|
;
|
|
|
|
; Parameter block for shell InitWildcardGS call (p 414 in ORCA/M manual)
|
|
|
|
;
|
|
|
|
InitWCParm dc i2'2' pCount
|
|
|
|
InitWCPath ds 4 Path name, with wildcard
|
1998-07-20 16:23:11 +00:00
|
|
|
dc i2'%00000001' Flags (this bit not documented!!!)
|
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
|
|
|
|
1998-08-03 17:30:30 +00:00
|
|
|
;
|
|
|
|
; Parameter block for shell NextWildcardGS call (p 414 in ORCA/M manual)
|
|
|
|
;
|
|
|
|
nWCparm dc i2'1' pCount
|
|
|
|
nWCname ds 4 Pointer to returned path name
|
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
|
|
|
|
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
|
|
|
nomatch dc c'No match',h'0d00'
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
END
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
**************************************************************************
|
|
|
|
*
|
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
|
|
|
* Expand $variables and tildes not in single quotes
|
1997-11-18 05:31:00 +00:00
|
|
|
*
|
|
|
|
**************************************************************************
|
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
expandvars START
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
; Maximum number of characters in an environment variable or $<
|
|
|
|
MAXVAL equ 512
|
|
|
|
|
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
ptr equ 1
|
|
|
|
buf equ ptr+4
|
|
|
|
dflag equ buf+4
|
|
|
|
space equ dflag+2
|
|
|
|
cmd equ space+3
|
|
|
|
end equ cmd+4
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
; subroutine (4:cmd),space
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
tsc
|
|
|
|
sec
|
|
|
|
sbc #space-1
|
|
|
|
tcs
|
|
|
|
phd
|
|
|
|
tcd
|
1997-11-18 05:31:00 +00:00
|
|
|
|
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
|
|
|
stz dflag Delimiter flag = FALSE.
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
jsl alloc1024
|
1998-09-08 16:53:14 +00:00
|
|
|
sta buf
|
|
|
|
sta ptr
|
|
|
|
stx buf+2
|
|
|
|
stx ptr+2
|
|
|
|
|
|
|
|
loop jsr e_getbyte
|
|
|
|
jeq done
|
|
|
|
if2 @a,eq,#"'",quote
|
|
|
|
if2 @a,eq,#'$',expand
|
|
|
|
if2 @a,eq,#'~',tilde
|
|
|
|
if2 @a,eq,#'\',slasher
|
|
|
|
jsr e_putbyte
|
|
|
|
bra loop
|
|
|
|
|
|
|
|
slasher jsr e_putbyte
|
|
|
|
jsr e_getbyte
|
|
|
|
jsr e_putbyte
|
|
|
|
bra loop
|
|
|
|
|
|
|
|
quote jsr e_putbyte
|
|
|
|
jsr e_getbyte
|
|
|
|
jeq done
|
|
|
|
if2 @a,ne,#"'",quote
|
|
|
|
jsr e_putbyte
|
|
|
|
bra loop
|
1997-11-18 05:31:00 +00:00
|
|
|
|
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
|
|
|
;
|
|
|
|
; Tilde expansion: use the contents of $home, but make sure the
|
|
|
|
; path delimiter(s) match what the user wants (either "/" or ":")
|
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
tilde anop
|
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
|
|
|
lock exp_mutex
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
lda #"oh" Strangely enough,
|
|
|
|
sta name this spells "home"!
|
|
|
|
lda #"em"
|
|
|
|
sta name+2
|
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
|
|
|
sta dflag Delimiter flag = TRUE.
|
1998-09-08 16:53:14 +00:00
|
|
|
ldx #4
|
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
|
|
|
jmp getval
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
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
|
|
|
; Expand an environment variable since a '$' was encountered.
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
expand anop
|
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
|
|
|
lock exp_mutex
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
lda #0
|
|
|
|
sta name
|
1997-11-18 05:31:00 +00:00
|
|
|
lda [cmd]
|
|
|
|
and #$FF
|
|
|
|
if2 @a,eq,#'{',braceexpand
|
|
|
|
if2 @a,eq,#'<',stdinexpand
|
1998-09-08 16:53:14 +00:00
|
|
|
ldx #0
|
|
|
|
nameloop lda [cmd]
|
|
|
|
and #$FF
|
|
|
|
beq getval
|
|
|
|
if2 @a,cc,#'0',getval
|
|
|
|
if2 @a,cc,#'9'+1,inname
|
|
|
|
if2 @a,cc,#'A',getval
|
|
|
|
if2 @a,cc,#'Z'+1,inname
|
|
|
|
if2 @a,eq,#'_',inname
|
|
|
|
if2 @a,cc,#'a',getval
|
|
|
|
if2 @a,cc,#'z'+1,inname
|
|
|
|
bra getval
|
|
|
|
inname jsr e_getbyte
|
1998-07-20 16:23:11 +00:00
|
|
|
cpx #255 Only the first 255 characters
|
|
|
|
beq nameloop are significant.
|
1998-09-08 16:53:14 +00:00
|
|
|
sta name,x
|
|
|
|
inx
|
|
|
|
bra nameloop
|
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
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
|
|
|
; expand in braces {}
|
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
braceexpand jsr e_getbyte
|
1997-11-18 05:31:00 +00:00
|
|
|
ldx #0
|
1998-09-08 16:53:14 +00:00
|
|
|
braceloop lda [cmd]
|
1997-11-18 05:31:00 +00:00
|
|
|
and #$FF
|
|
|
|
beq getval
|
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
|
|
|
jsr e_getbyte
|
1997-11-18 05:31:00 +00:00
|
|
|
if2 @a,eq,#'}',getval
|
1998-07-20 16:23:11 +00:00
|
|
|
cpx #255 Only the first 255 characters
|
|
|
|
beq braceloop are significant.
|
1997-11-18 05:31:00 +00:00
|
|
|
sta name,x
|
|
|
|
inx
|
|
|
|
bra braceloop
|
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
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
|
|
|
; get text from standard input
|
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
stdinexpand jsr e_getbyte
|
1998-08-03 17:30:30 +00:00
|
|
|
ReadLine (#value,#MAXVAL,#13,#0),@a
|
1998-07-20 16:23:11 +00:00
|
|
|
sta valueln
|
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
|
|
|
bra chklen
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-07-20 16:23:11 +00:00
|
|
|
; Get a value for this variable
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
getval stx nameln Save length of name.
|
|
|
|
ReadVariableGS ReadVarPB Read its value.
|
1998-07-20 16:23:11 +00:00
|
|
|
|
|
|
|
lda valueln Get value length.
|
|
|
|
cmp #MAXVAL+1 If > maximum allowed length,
|
|
|
|
bcs expanded we didn't get anything.
|
|
|
|
cmp #0
|
|
|
|
chklen anop
|
1998-09-08 16:53:14 +00:00
|
|
|
beq expanded If 0, nothing to do
|
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
|
|
|
tax Save length in X-reg.
|
|
|
|
lda dflag If delimiter flag isn't set,
|
|
|
|
beq storeval go store the variable value
|
|
|
|
|
|
|
|
; Check to see if delimiters in the variable need to be switched
|
1998-07-20 16:23:11 +00:00
|
|
|
lda valueln Set up length in
|
|
|
|
tax X-reg and get
|
|
|
|
lda [cmd] next command line
|
|
|
|
and #$FF character.
|
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
|
|
|
cmp #"/" If it's a slash, see if
|
|
|
|
beq chkvarslash variable needs to convert to slash.
|
|
|
|
cmp #":" If it's not a colon,
|
|
|
|
bne storeval no need to convert.
|
1998-07-20 16:23:11 +00:00
|
|
|
lda value Get first character of value.
|
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
|
|
|
and #$FF
|
|
|
|
cmp #"/" If it's not a slash,
|
|
|
|
bne storeval no need to convert.
|
|
|
|
|
|
|
|
; Convert variable from "/" to ":" delimiter
|
|
|
|
short m
|
1998-07-20 16:23:11 +00:00
|
|
|
chk_s lda value-1,x
|
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
|
|
|
cmp #"/"
|
|
|
|
bne bump_s
|
|
|
|
lda #":"
|
1998-07-20 16:23:11 +00:00
|
|
|
sta value-1,x
|
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
|
|
|
bump_s dex
|
|
|
|
bpl chk_s
|
|
|
|
long m
|
|
|
|
bra storeval
|
|
|
|
|
|
|
|
chkvarslash anop
|
1998-07-20 16:23:11 +00:00
|
|
|
lda value Get first character of value.
|
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
|
|
|
and #$FF
|
|
|
|
cmp #":" If it's not a colon,
|
|
|
|
bne storeval no need to convert.
|
|
|
|
|
|
|
|
; Convert variable from ":" to "/" delimiter
|
|
|
|
short m
|
1998-07-20 16:23:11 +00:00
|
|
|
chk_c lda value-1,x
|
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
|
|
|
cmp #":"
|
|
|
|
bne bump_c
|
|
|
|
lda #"/"
|
1998-07-20 16:23:11 +00:00
|
|
|
sta value-1,x
|
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
|
|
|
bump_c dex
|
|
|
|
bpl chk_c
|
|
|
|
long m
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-07-20 16:23:11 +00:00
|
|
|
; Store the variable's value in the out buffer
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
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
|
|
|
storeval anop
|
1998-07-20 16:23:11 +00:00
|
|
|
lda valueln Get length.
|
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
|
|
|
tay Save length in Y-reg.
|
1998-09-08 16:53:14 +00:00
|
|
|
ldx #0 Use X-reg in index value.
|
|
|
|
putval lda value,x
|
|
|
|
jsr e_putbyte
|
|
|
|
inx
|
1997-11-18 05:31:00 +00:00
|
|
|
dey
|
1998-09-08 16:53:14 +00:00
|
|
|
bne putval
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
expanded unlock exp_mutex
|
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
|
|
|
stz dflag Delimiter flag = FALSE.
|
1998-09-08 16:53:14 +00:00
|
|
|
jmp loop
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
done jsr e_putbyte
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
ldx buf+2
|
|
|
|
ldy buf
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
lda space
|
|
|
|
sta end-3
|
|
|
|
lda space+1
|
|
|
|
sta end-2
|
|
|
|
pld
|
|
|
|
tsc
|
|
|
|
clc
|
|
|
|
adc #end-4
|
|
|
|
tcs
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
tya
|
|
|
|
rtl
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
e_getbyte lda [cmd]
|
|
|
|
incad cmd
|
|
|
|
and #$FF
|
|
|
|
rts
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
e_putbyte short a
|
|
|
|
sta [ptr]
|
|
|
|
long a
|
|
|
|
incad ptr
|
1998-09-08 16:53:14 +00:00
|
|
|
rts
|
1997-11-18 05:31:00 +00:00
|
|
|
|
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
|
|
|
exp_mutex key
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
; GS/OS string to hold variable name
|
|
|
|
namestr anop
|
|
|
|
nameln ds 2 Length of name
|
1998-09-08 16:53:14 +00:00
|
|
|
name ds 256 Room for 255 chars + 0.
|
1998-07-20 16:23:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
; GS/OS result buffer to hold up to MAXVAL bytes of value
|
|
|
|
valueresult anop
|
|
|
|
dc i2'MAXVAL+4' Length of result buffer
|
|
|
|
valueln ds 2 Length of value
|
1998-09-08 16:53:14 +00:00
|
|
|
value ds MAXVAL Room for MAXVAL chars
|
1998-07-20 16:23:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
; Parameter block for shell ReadVariableGS calls
|
|
|
|
ReadVarPB anop
|
|
|
|
dc i2'3' pCount
|
|
|
|
RVname dc a4'namestr' Name (pointer to GS/OS string)
|
|
|
|
RVvalue dc a4'valueresult' Value (ptr to result buf or string)
|
|
|
|
RVexport ds 2 Export flag
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
END
|