<feed xmlns='http://www.w3.org/2005/Atom'>
<title>busybox-w32/shell, branch path_search</title>
<subtitle>A mirror of https://github.com/rmyorston/busybox-w32.git
</subtitle>
<id>https://git.lua4.win/busybox-w32/atom?h=path_search</id>
<link rel='self' href='https://git.lua4.win/busybox-w32/atom?h=path_search'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/'/>
<updated>2024-06-12T11:43:39+00:00</updated>
<entry>
<title>win32: allow for trailing separator in PATH</title>
<updated>2024-06-12T11:43:39+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-06-12T11:34:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=2817c3d4f3fb60b6719782cde57a6b7347cf2898'/>
<id>urn:sha1:2817c3d4f3fb60b6719782cde57a6b7347cf2898</id>
<content type='text'>
In recent versions of Windows the PATH environment variable has
a trailing semicolon.  This is insignificant to Windows because
it's ignored.  busybox-w32 conforms to the POSIX interpretation
of PATH which treats an empty path element as denoting the current
directory.  As result, on these versions of Windows executables
may by default be run from the current directory, contrary to
usual Unix practice.

Attempt to detect and remove the trailing semicolon on applet
start up.  If the user insists, they can add a trailing semicolon
to the shell variable PATH and it will be respected in the
conventional manner.

Adds 88-112 bytes.
</content>
</entry>
<entry>
<title>ash: fix comment</title>
<updated>2024-05-22T06:51:34+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-05-22T06:51:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=a643b5541b71ce5413739a93a560e097947afece'/>
<id>urn:sha1:a643b5541b71ce5413739a93a560e097947afece</id>
<content type='text'>
</content>
</entry>
<entry>
<title>ash: prevent mintty from setting HOME</title>
<updated>2024-05-21T07:36:09+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-05-21T07:36:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=05b053cd388219d6b194b99ce9e543271dab121f'/>
<id>urn:sha1:05b053cd388219d6b194b99ce9e543271dab121f</id>
<content type='text'>
The Cygwin terminal program mintty sets the HOME environment
variable.  Attempt to detect this and unset HOME so the usual
busybox-w32 initialisation of HOME is used instead.

Adds 80 bytes.

(GitHub issue #420)
</content>
</entry>
<entry>
<title>ash: -X option shouldn't alter environment variables</title>
<updated>2024-05-10T13:32:45+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-05-10T13:32:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=bb128070e590234f8b63fb1d67f7621a1b4b3ff3'/>
<id>urn:sha1:bb128070e590234f8b63fb1d67f7621a1b4b3ff3</id>
<content type='text'>
When a shell was started with the -X option, environment variables
had forward slashes changed to backslashes.  This is unnecessary
and counterproductive.

Adjust how the state of winxp is handled to avoid this.

(GitHub issue #415)
</content>
</entry>
<entry>
<title>ash: fix typo</title>
<updated>2024-04-30T09:15:24+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-04-30T09:15:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=8e0a1ad5e4c1fa3698cc581fedcaf339a3387a35'/>
<id>urn:sha1:8e0a1ad5e4c1fa3698cc581fedcaf339a3387a35</id>
<content type='text'>
</content>
</entry>
<entry>
<title>ash: fix alias expansion followed by '&amp;'</title>
<updated>2024-04-30T08:08:00+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-04-30T08:08:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=6b164f335c548bcebacd8bf984fd5c34ede46891'/>
<id>urn:sha1:6b164f335c548bcebacd8bf984fd5c34ede46891</id>
<content type='text'>
An alias expansion immediately followed by '&amp;' is parsed
incorrectly:

   ~ $ alias x='sleep 2'
   ~ $ x&amp;
   ~ $
   sh: syntax error: unexpected "&amp;"

The sleep happens in the foreground and the '&amp;' is left in the
input buffer.  The same problem occurs in upstream BusyBox but
not dash.

The difference between BusyBox and dash is that BusyBox supports
bash-style output redirection (BASH_REDIR_OUTPUT in the code).
This requires checking for '&amp;&gt;' in readtoken1().

When the end of the alias is found, the '&amp;' and the following
newline are both read to check for '&amp;&gt;'.  Since there's no match
both characters are pushed back.

The alias is then expanded and __pgetc() is called to fetch the
next character.  Since there are none left in the alias string
__pgetc() calls preadbuffer() which pops the string, reverts to
the previous input and recursively calls __pgetc().  This request
is satisified from the pungetc buffer.  But the first __pgetc()
doesn't know this: it sees the character has come from
preadbuffer() so it (incorrectly) updates the pungetc buffer.

Resolve the issue by moving the code to pop the string and fetch
the next character up from preadbuffer() into __pgetc().

Saves 32-48 bytes.

(GitHub issue #413)
</content>
</entry>
<entry>
<title>ash: add 'noiconify' option</title>
<updated>2024-04-29T10:10:53+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-04-29T10:10:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=818cf3b0c7dae0b06d0103998f1eef14964b63c7'/>
<id>urn:sha1:818cf3b0c7dae0b06d0103998f1eef14964b63c7</id>
<content type='text'>
The 'noiconify' option controls how the console window is concealed
when the 'noconsole' option is used.  The default is to iconify
the console.  When 'noiconify' is 'on' the console is hidden.

Adds 8-16 bytes.

(GitHub issue #325)
</content>
</entry>
<entry>
<title>ash: detect console state on every call to options()</title>
<updated>2024-04-29T09:37:59+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-04-29T09:37:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=af195b0c979c53739d0ba7e054667b3c548feaa9'/>
<id>urn:sha1:af195b0c979c53739d0ba7e054667b3c548feaa9</id>
<content type='text'>
Commit 67ed7484be (ash: detect console state on shell start up)
synchronised the noconsole option with the actual state of the
window on shell start up.

This is insufficient.  The user can change the state of the window
independently of the noconsole option, leading to confusion and
unwanted iconification of the window when unrelated 'set' commands
are issued.

Detect the current console state on every call to options().

Saves 16-32 bytes.

(GitHub issue #325)
</content>
</entry>
<entry>
<title>win32: adjust handling of executable extensions</title>
<updated>2024-04-22T06:54:34+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-04-22T06:54:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=b5131ae1c0bb7984b35c909d04e2f4a61a7b6d8f'/>
<id>urn:sha1:b5131ae1c0bb7984b35c909d04e2f4a61a7b6d8f</id>
<content type='text'>
Mixing Windows and Unix-style filename extensions was causing
problems.  Tweak how extensions are handled to try and improve
matters:

- Consistently check whether the unaltered filename is an
  executable before trying adding extensions.

- Check .exe and .com before .sh.

Saves up to 16 bytes.

(GitHub issue #405)
</content>
</entry>
<entry>
<title>ash: move setting of current directory</title>
<updated>2024-04-09T11:43:48+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-04-09T11:43:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=7e09f7ce4e0d99b0e54684e5cc506e1532db392f'/>
<id>urn:sha1:7e09f7ce4e0d99b0e54684e5cc506e1532db392f</id>
<content type='text'>
The undocumented '-d' shell option is used to set the current
directory in shells started by the 'su' applet of busybox-w32.
In this case, the shell isn't a login shell.

If a login shell sets the current working directory in /etc/profile
it's possible the user may wish to override this with '-d'.  This
didn't work, though, because the directory is changed before
/etc/profile is processed.

Move the changing of the directory to that specified by '-d' so it
happens after the processing of /etc/profile and ~/.profile.  This
won't affect the intended use of '-d'.

(GitHub issue #403)
</content>
</entry>
</feed>
