ls fix: d flag
This commit is contained in:
parent
369f3af147
commit
1301d3f5ef
|
@ -151,7 +151,9 @@ int print(const struct d_node *node) {
|
|||
char ind = '-';
|
||||
char *color = "";
|
||||
if (S_ISDIR(node->stats.st_mode)) {
|
||||
suf = '/';
|
||||
if (node->name[strlen(node->name) - 1] != '/')
|
||||
suf = '/';
|
||||
|
||||
ind = 'd';
|
||||
color = LS_DIR_COLOR;
|
||||
}
|
||||
|
@ -220,10 +222,7 @@ void col_print(struct d_node **node, size_t files, struct winsize w) {
|
|||
maxlen = strlen(node[i]->name);
|
||||
|
||||
/* Calc */
|
||||
maxlen += 2;
|
||||
if (F_flag)
|
||||
maxlen++;
|
||||
|
||||
maxlen += 3;
|
||||
size_t ncols = w.ws_col / maxlen;
|
||||
size_t nrows = files;
|
||||
if (ncols > 1) {
|
||||
|
|
Loading…
Reference in New Issue