summaryrefslogtreecommitdiff
path: root/system/busybox/0001-cat-fix-cat-e-and-cat-v-erroneously-numbering-1st-li.patch
diff options
context:
space:
mode:
authorKiyoshi Aman <kiyoshi.aman+apkfission@gmail.com>2018-07-04 07:01:10 -0500
committerKiyoshi Aman <kiyoshi.aman+apkfission@gmail.com>2018-07-04 10:28:32 -0500
commit4d6fdd8bd190dc41a7e179c929ac6b693b0eebd7 (patch)
tree6e47455832c8b633c7714d42fa741c376b1ba0bd /system/busybox/0001-cat-fix-cat-e-and-cat-v-erroneously-numbering-1st-li.patch
parente383b8782bbb48262f8123f2d7cb296c38fb057f (diff)
downloadpackages-4d6fdd8bd190dc41a7e179c929ac6b693b0eebd7.tar.gz
packages-4d6fdd8bd190dc41a7e179c929ac6b693b0eebd7.tar.bz2
packages-4d6fdd8bd190dc41a7e179c929ac6b693b0eebd7.tar.xz
packages-4d6fdd8bd190dc41a7e179c929ac6b693b0eebd7.zip
system/busybox: upgrade to 1.28.4
Diffstat (limited to 'system/busybox/0001-cat-fix-cat-e-and-cat-v-erroneously-numbering-1st-li.patch')
-rw-r--r--system/busybox/0001-cat-fix-cat-e-and-cat-v-erroneously-numbering-1st-li.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/system/busybox/0001-cat-fix-cat-e-and-cat-v-erroneously-numbering-1st-li.patch b/system/busybox/0001-cat-fix-cat-e-and-cat-v-erroneously-numbering-1st-li.patch
new file mode 100644
index 000000000..4680b920e
--- /dev/null
+++ b/system/busybox/0001-cat-fix-cat-e-and-cat-v-erroneously-numbering-1st-li.patch
@@ -0,0 +1,63 @@
+From d80eecb86812c1fbda652f9b995060c26ba0b155 Mon Sep 17 00:00:00 2001
+From: Denys Vlasenko <vda.linux@googlemail.com>
+Date: Sun, 29 Apr 2018 14:05:43 +0200
+Subject: [PATCH] cat: fix cat -e and cat -v erroneously numbering 1st line
+
+function old new delta
+cat_main 418 421 +3
+
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+---
+ coreutils/cat.c | 6 +++---
+ testsuite/cat.tests | 21 +++++++++++++++++++++
+ 2 files changed, 24 insertions(+), 3 deletions(-)
+ create mode 100755 testsuite/cat.tests
+
+diff --git a/coreutils/cat.c b/coreutils/cat.c
+index 5f02233ca..fb735f994 100644
+--- a/coreutils/cat.c
++++ b/coreutils/cat.c
+@@ -112,10 +112,10 @@ static int catv(unsigned opts, char **argv)
+ int retval = EXIT_SUCCESS;
+ int fd;
+ #if ENABLE_FEATURE_CATN
+- unsigned lineno = 0;
+- unsigned eol_char = (opts & (CAT_OPT_n|CAT_OPT_b)) ? '\n' : 0x100;
++ bool eol_seen = (opts & (CAT_OPT_n|CAT_OPT_b));
++ unsigned eol_char = (eol_seen ? '\n' : 0x100);
+ unsigned skip_num_on = (opts & CAT_OPT_b) ? '\n' : 0x100;
+- bool eol_seen = 1;
++ unsigned lineno = 0;
+ #endif
+
+ BUILD_BUG_ON(CAT_OPT_e != VISIBLE_ENDLINE);
+diff --git a/testsuite/cat.tests b/testsuite/cat.tests
+new file mode 100755
+index 000000000..404ebedeb
+--- /dev/null
++++ b/testsuite/cat.tests
+@@ -0,0 +1,21 @@
++#!/bin/sh
++
++# Copyright 2018 by Denys Vlasenko <vda.linux@googlemail.com>
++# Licensed under GPLv2, see file LICENSE in this source tree.
++
++. ./testing.sh
++
++# testing "description" "command" "result" "infile" "stdin"
++testing 'cat -e' \
++ 'cat -e' \
++ 'foo$\n' \
++ '' \
++ 'foo\n'
++
++testing 'cat -v' \
++ 'cat -v' \
++ 'foo\n' \
++ '' \
++ 'foo\n'
++
++exit $FAILCOUNT
+--
+2.17.0
+