-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cut: fix substring for -b flag (#595)
* The substring length calculation in handle_b() wasn't correct in all cases * If start==end, then length==1 * Pass parameters to handle_b() and handle_f() * Use defined() to test for presence of command options; 0 should not be ignored * test1: "perl cut -b 2-3 a.c" -> chars 2-3 * test2: "perl cut -b -3 a.c" -> chars 1-3 * test3: "perl cut -b 10 a.c" -> char 10 * test4: "perl cut -f 1,2 -s -d ' ' a.c" -> fields 1&2, delimited by space, ignoring lines without a space
- Loading branch information
Showing
1 changed file
with
25 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters