Skip to content

Commit f2279d9

Browse files
committed
Fix according to PR reviews
1 parent 1b1928e commit f2279d9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • implement-shell-tools/cat

implement-shell-tools/cat/cat.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ const numberAll = options.number && !numberNonBlank;
3737
}
3838
}
3939
} else if (numberAll) {
40-
const maxDigits = String(lines.length * filePaths.length).length; // max digits to pad across files
40+
const maxDigits = totalLines > 0 ? String(totalLines).length : 1;
41+
4142

4243
for (const line of lines) {
4344
const numStr = String(lineNumber++).padStart(maxDigits, " ");

0 commit comments

Comments
 (0)