Commit 2d2b17a
authored
ls: incorrect column widths in -R mode
* The column widths for "ls -R" didn't always look right
* List() is called for each directory/subdirectory
* Global variable $Maxlen is increased by 1 unconditionally, despite the value being saved from the previous call
* When I tested "perl ls -R .." I observed $Maxlen values from 21-59, incrementing by 1 for each directory
* The entries for the subdirectories are printed with too much space
* When I compare the output of GNU ls, the column widths are calculated for each directory listed
* Fix this by making $Maxlen a non-global; it is only used in List() and the value between calls should not be saved
* Extra: remove unused variable $BlockSize1 parent 8d0d173 commit 2d2b17a
1 file changed
+1
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | 113 | | |
115 | 114 | | |
116 | 115 | | |
| |||
314 | 313 | | |
315 | 314 | | |
316 | 315 | | |
317 | | - | |
318 | | - | |
319 | 316 | | |
320 | 317 | | |
321 | 318 | | |
322 | 319 | | |
| 320 | + | |
323 | 321 | | |
324 | 322 | | |
325 | 323 | | |
| |||
0 commit comments