summaryrefslogtreecommitdiffstats
path: root/usr.bin/tr
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2002-03-02 10:36:37 +0000
committeralfred <alfred@FreeBSD.org>2002-03-02 10:36:37 +0000
commit4461fe46999f88bc903ba85a6b4f81a34b92edeb (patch)
tree67d33c69b5698f1ffbf9b625d7713eb7f4c890dd /usr.bin/tr
parent71fa5068bb05736698cc572c3b07a35d092a87e6 (diff)
downloadFreeBSD-src-4461fe46999f88bc903ba85a6b4f81a34b92edeb.zip
FreeBSD-src-4461fe46999f88bc903ba85a6b4f81a34b92edeb.tar.gz
properly handle zero length first string when doing -c
PR: 34663 MFC After: 3 days
Diffstat (limited to 'usr.bin/tr')
-rw-r--r--usr.bin/tr/tr.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.bin/tr/tr.c b/usr.bin/tr/tr.c
index a7ed0c9..53bd265 100644
--- a/usr.bin/tr/tr.c
+++ b/usr.bin/tr/tr.c
@@ -212,6 +212,7 @@ main(argc, argv)
if (!next(&s2))
errx(1, "empty string2");
+ ch = s2.lastch;
/* If string2 runs out of characters, use the last one specified. */
if (sflag)
while (next(&s1)) {
OpenPOWER on IntegriCloud