Bug 207 - weird behavior with hush, printf, and empty args
Summary: weird behavior with hush, printf, and empty args
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: unspecified
Hardware: PC Linux
: P5 enhancement
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-20 10:42 UTC by Mike Frysinger
Modified: 2009-03-20 12:37 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Frysinger 2009-03-20 10:42:11 UTC
i cant explain this one ...

$ cat test.sh
printf '%s\n' "$@"
$ ./busybox hush ./test.sh
n$

looks like when printf %s gets "" it incorrectly consumes an extra byte ?

bash works fine:
$ sh ./test.sh

$
Comment 1 Denys Vlasenko 2009-03-20 10:52:10 UTC
It just converts "\n" to "n". strace:

execve("/root/bin/printf", ["printf", "%sn"], [/* 30 vars */])...

Looking into it...
Comment 2 Mike Frysinger 2009-03-20 11:12:57 UTC
i say "weird" because it works fine with arguments:
$ ./busybox hush ./test.sh 1
1
$
Comment 3 Denys Vlasenko 2009-03-20 11:33:53 UTC
I updated hush hot fix, please try it:

http://busybox.net/downloads/fixes-1.13.3/busybox-1.13.3-hush.patch
Comment 4 Mike Frysinger 2009-03-20 12:37:00 UTC
yep, thanks