<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dash/src/bltin, branch master</title>
<subtitle>patched shell with cmake build
</subtitle>
<id>https://git.causal.agency/dash/atom?h=master</id>
<link rel='self' href='https://git.causal.agency/dash/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.causal.agency/dash/'/>
<updated>2022-01-22T03:26:28+00:00</updated>
<entry>
<title>dash: Stop this stat64 nonsense</title>
<updated>2022-01-22T03:26:28+00:00</updated>
<author>
<name>June McEnroe</name>
<email>june@causal.agency</email>
</author>
<published>2022-01-22T03:26:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.causal.agency/dash/commit/?id=22fb2a07db173532462d90ad875a06254e932773'/>
<id>urn:sha1:22fb2a07db173532462d90ad875a06254e932773</id>
<content type='text'>
</content>
</entry>
<entry>
<title>shell: Always use explicit large file API</title>
<updated>2020-05-15T06:24:38+00:00</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2020-05-07T13:42:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.causal.agency/dash/commit/?id=3e3e7af1a49273a5e49d50565b3b079a2ab19142'/>
<id>urn:sha1:3e3e7af1a49273a5e49d50565b3b079a2ab19142</id>
<content type='text'>
There are some remaining stat/readdir calls in dash that may lead
to spurious EOVERFLOW errors on 32-bit platforms.  This patch changes
them (as well as open(2)) to use the explicit large file API.

Reported-by: Tatsuki Sugiura &lt;sugi@nemui.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>builtin: Fix seconds part of times(1)</title>
<updated>2020-04-29T06:04:17+00:00</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2020-01-20T09:46:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.causal.agency/dash/commit/?id=fd5311ace04bcc2fea0a330c95a3423931ec45fa'/>
<id>urn:sha1:fd5311ace04bcc2fea0a330c95a3423931ec45fa</id>
<content type='text'>
The seconds part of the times(1) built-in is wrong as it does not
exclude the minutes part of the result.  This patch fixes it.

This problem was first noted by Michael Greenberg who also sent
a similar patch.

Reported-by: Michael Greenberg &lt;michael.greenberg@pomona.edu&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>builtin: Use test_access from NetBSD when faccessat is unavailable</title>
<updated>2018-05-28T09:12:23+00:00</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2018-05-19T17:30:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.causal.agency/dash/commit/?id=03cbaba30d7f6e4f89b6e881b6b909cb45924025'/>
<id>urn:sha1:03cbaba30d7f6e4f89b6e881b6b909cb45924025</id>
<content type='text'>
This patch adds the test_access code from NetBSD when faccess is
unavailable.  The code has been modified so that root can always
read/write any file.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>builtin: Move echo space/nl handling into print_escape_str</title>
<updated>2018-04-02T15:30:44+00:00</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2018-03-25T07:55:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.causal.agency/dash/commit/?id=325a460c7942aa79bb97303e129980db8afd177c'/>
<id>urn:sha1:325a460c7942aa79bb97303e129980db8afd177c</id>
<content type='text'>
Currently echocmd uses print_escape_str to do everything apart
from printing the spaces/newlines separating its arguments.  This
patch moves the actual printing into print_escape_str as well
using the format parameter.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>builtin: Fix echo performance regression</title>
<updated>2018-04-02T15:30:44+00:00</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2018-03-25T03:50:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.causal.agency/dash/commit/?id=42b730b034eebd0e9da4aa014785a3ee5de436be'/>
<id>urn:sha1:42b730b034eebd0e9da4aa014785a3ee5de436be</id>
<content type='text'>
The commit d6c0e1e2ffbf7913ab69d51cc794d48d41c8fcb1 ("[BUILTIN]
Handle embedded NULs correctly in printf") caused a performance
regression in the echo built-in because every echo call now goes
through the printf %b slow path where the string is always printed
twice to ensure the space padding is correct in the presence of
NUL characters.  In fact this regression applies to printf %b as
well.

This is easily fixed by making printf %b take the fast path when
no precision/field width modifiers are present.

This patch also changes the second strchurnul call to strspn which
generates slightly better code.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>Revert "[BUILTIN] Remove unnecessary restoration of format string in printf"</title>
<updated>2018-03-25T02:33:38+00:00</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2018-03-25T02:33:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.causal.agency/dash/commit/?id=fcb3864e0e348c206c12b3dae9e734d1efa2029e'/>
<id>urn:sha1:fcb3864e0e348c206c12b3dae9e734d1efa2029e</id>
<content type='text'>
This reverts commit 7bb413255368e94395237d789f522891093c5774.

The commit breaks printf with more than argument.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>builtin: Greater resolution in test -nt / test -ot</title>
<updated>2018-03-21T16:25:35+00:00</updated>
<author>
<name>Martijn Dekker</name>
<email>martijn@inlv.org</email>
</author>
<published>2018-03-07T17:32:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.causal.agency/dash/commit/?id=fc914153d433b063b9ed11f3ace668c5c866f379'/>
<id>urn:sha1:fc914153d433b063b9ed11f3ace668c5c866f379</id>
<content type='text'>
Op 07-03-18 om 15:46 schreef Martijn Dekker:
&gt; Op 06-03-18 om 09:19 schreef Herbert Xu:
&gt;&gt; On Thu, Jun 22, 2017 at 10:30:02AM +0200, Petr Skočík wrote:
&gt;&gt;&gt; would you be willing to pull something like this?
&gt; [...]
&gt;&gt;&gt; I could use greater resolution in `test -nt` / `test -ot`, and st_mtim
&gt;&gt;&gt; field is standardized under POSIX.1-2008 (or so stat(2) says).
&gt;&gt;
&gt;&gt; Sure.  But your patch is corrupted.
&gt;
&gt; Fixed patch attached.
&gt;
&gt; But I wouldn't apply it as is. My system does not have st_mtim. So I
&gt; think it needs a configure test and a fallback to the old method.

Here's an attempt to make that happen. See attached.

- M.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>builtin: Fix echo -n early termination</title>
<updated>2016-09-02T14:10:56+00:00</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2016-09-02T13:14:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.causal.agency/dash/commit/?id=4cf38c1ccd0c41715633c1b724c30e9c235099d1'/>
<id>urn:sha1:4cf38c1ccd0c41715633c1b724c30e9c235099d1</id>
<content type='text'>
The commit 7a784244625d5489c0fc779201c349555dc5f8bc ("[BUILTIN]
Simplify echo command") broke echo -n by making it always terminate
after printing the first argument.

This patch fixes this by only terminating when we have reached
the end of the arguments.

Fixes: 7a784244625d ("[BUILTIN] Simplify echo command")
Reported-by: Luigi Tarenga &lt;luigi.tarenga@gmail.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>builtin: Reject malformed printf specifications with digits after '*'</title>
<updated>2016-06-06T10:32:56+00:00</updated>
<author>
<name>Patrick Brown</name>
<email>opensource@whoopdedo.org</email>
</author>
<published>2015-12-06T14:09:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.causal.agency/dash/commit/?id=0134f725b7d254ddbc3cc6dd72399edea832559c'/>
<id>urn:sha1:0134f725b7d254ddbc3cc6dd72399edea832559c</id>
<content type='text'>
Dash doesn't notice when a format string has digits following a * width
specifier.

    $ dash -c 'printf "%*0s  " 1 2 &amp;&amp; echo FAIL || echo OK'
    %10s  FAIL

    $ bash -c 'printf "%*0s  " 1 2 &amp;&amp; echo FAIL || echo OK'
    bash: line 0: printf: `0': invalid format character
    OK
    $ mksh -c 'printf "%*0s  " 1 2 &amp;&amp; echo FAIL || echo OK'
    printf: %*0: invalid conversion specification
    OK

With this patch dash complains about the malformed specifications.

    $ ./src/dash -c 'printf "%*0s  " 1 2 &amp;&amp; echo FAIL || echo OK'
    ./src/dash: 1: printf: %*0: invalid directive
    OK

Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=779618

Originally-by: Patrick Brown &lt;opensource@whoopdedo.org&gt;
Forwarded-by: Gioele Barabucci &lt;gioele@svario.it&gt;

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
</feed>
