Commit a67d122
authored
wc: inconsistent byte counts (briandfoy#918)
* The byte count reported by wc was different depending on whether the -w option is set (-w is set by default)
* The the code for $opt_w was modifying the line string to calculate a word count before the code for the other options is able to inspect the line
* This patch makes the code $opt_w modify its own copy of the line
%stat aaa.c
File: aaa.c
Size: 470 Blocks: 8 IO Block: 4096 regular file
Device: b302h/45826d Inode: 1034312 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ pi) Gid: ( 1000/ pi)
Access: 2024-11-18 12:56:23.329998345 +0800
Modify: 2024-11-18 12:56:23.329998345 +0800
Change: 2024-11-18 12:56:23.329998345 +0800
Birth: 2024-11-18 12:56:23.329998345 +0800
%perl wc aaa.c
30 66 454 aaa.c
%perl wc -c aaa.c
470 aaa.c1 parent 147df70 commit a67d122
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
173 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
174 | 175 | | |
175 | 176 | | |
176 | 177 | | |
| |||
0 commit comments