]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
yes: fix copy and paste issue with previous commit
authorPádraig Brady <P@draigBrady.com>
Fri, 24 Jun 2016 00:09:28 +0000 (01:09 +0100)
committerPádraig Brady <P@draigBrady.com>
Fri, 24 Jun 2016 00:09:28 +0000 (01:09 +0100)
* src/yes.c (main): Output 'y' not '-'.
* tests/misc/yes.sh: Add a test for default output.

src/yes.c
tests/misc/yes.sh

index e127310f19233addcf9476733a4a8949e126e79e..a3b25ce08912de099f000883f86f2aead976dc30 100644 (file)
--- a/src/yes.c
+++ b/src/yes.c
@@ -76,7 +76,7 @@ main (int argc, char **argv)
 
   char **operand_lim = argv + argc;
   if (optind == argc)
-    *operand_lim++ = bad_cast ("-");
+    *operand_lim++ = bad_cast ("y");
 
   /* Buffer data locally once, rather than having the
      large overhead of stdio buffering each item.  */
index a3027432bd5abd6fbeafe0bf6b40cc30035d26b2..c8ef65a7fd6126fce670209c5c49856c00465846 100755 (executable)
@@ -19,6 +19,9 @@
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ yes
 
+# Check basic operation
+test "$(yes | head -n1)" = 'y' || fail=1
+
 # Check various single item sizes, with the most important
 # size being BUFSIZ used for the local buffer to yes(1).
 # Note a \n is added, so actual sizes required internally