summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-12-24 14:22:42 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-12-24 14:22:42 +0000
commit2a96bc93c24f34a972740da3e7df031a2d36e7cb (patch)
tree696c401338f8e5f176ace532fda02e8d1426be7e
parent3856ce50bfc3fc23d8b819f2a3970cf2af66882b (diff)
downloadexecline-2a96bc93c24f34a972740da3e7df031a2d36e7cb.tar.xz
Align dollarat option priority to rightmost
-rw-r--r--doc/dollarat.html5
-rw-r--r--src/execline/dollarat.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/doc/dollarat.html b/doc/dollarat.html
index 8249bd3..cb3d6eb 100644
--- a/doc/dollarat.html
+++ b/doc/dollarat.html
@@ -53,8 +53,9 @@ used. If <em>delimchar</em> is the empty string, then <tt>dollarat</tt>
will output the positional parameters as a
<a href="el_transform.html#netstrings">sequence of netstrings</a> (and the
<tt>-n</tt> option will be ignored). </li>
- <li> <tt>-0</tt>&nbsp;: use the null character as separator. Any <tt>-d</tt>
-argument will be ignored. Warning: this option should only be used to feed
+ <li> <tt>-0</tt>&nbsp;: use the null character as separator. If this option
+and the <tt>-d</tt> option are given concurrently, the rightmost one wins.
+Warning: <tt>-0</tt> should only be used to feed
data to programs that know how to handle null-separated lists. </li>
</ul>
diff --git a/src/execline/dollarat.c b/src/execline/dollarat.c
index 5bc5c1f..1b75027 100644
--- a/src/execline/dollarat.c
+++ b/src/execline/dollarat.c
@@ -28,7 +28,7 @@ int main (int argc, char const *const *argv)
switch (opt)
{
case 'n' : nl = 0 ; break ;
- case 'd' : delim = *l.arg ; break ;
+ case 'd' : delim = *l.arg ; zero = 0 ; break ;
case '0' : zero = 1 ; break ;
default : strerr_dieusage(100, USAGE) ;
}