Patch from Matt Kraai to fix debian bug number 231994.
There was an extra blank line preceding the first directory.
This commit is contained in:
parent
a89bbfb257
commit
c4db0833a6
@ -532,7 +532,7 @@ static void showfiles(struct dnode **dn, int nfiles)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------*/
|
||||||
static void showdirs(struct dnode **dn, int ndirs)
|
static void showdirs(struct dnode **dn, int ndirs, int first)
|
||||||
{
|
{
|
||||||
int i, nfiles;
|
int i, nfiles;
|
||||||
struct dnode **subdnp;
|
struct dnode **subdnp;
|
||||||
@ -547,7 +547,10 @@ static void showdirs(struct dnode **dn, int ndirs)
|
|||||||
|
|
||||||
for (i = 0; i < ndirs; i++) {
|
for (i = 0; i < ndirs; i++) {
|
||||||
if (all_fmt & (DISP_DIRNAME | DISP_RECURSIVE)) {
|
if (all_fmt & (DISP_DIRNAME | DISP_RECURSIVE)) {
|
||||||
printf("\n%s:\n", dn[i]->fullname);
|
if (!first)
|
||||||
|
printf("\n");
|
||||||
|
first = 0;
|
||||||
|
printf("%s:\n", dn[i]->fullname);
|
||||||
}
|
}
|
||||||
subdnp = list_dir(dn[i]->fullname);
|
subdnp = list_dir(dn[i]->fullname);
|
||||||
nfiles = countfiles(subdnp);
|
nfiles = countfiles(subdnp);
|
||||||
@ -566,7 +569,7 @@ static void showdirs(struct dnode **dn, int ndirs)
|
|||||||
#ifdef CONFIG_FEATURE_LS_SORTFILES
|
#ifdef CONFIG_FEATURE_LS_SORTFILES
|
||||||
shellsort(dnd, dndirs);
|
shellsort(dnd, dndirs);
|
||||||
#endif
|
#endif
|
||||||
showdirs(dnd, dndirs);
|
showdirs(dnd, dndirs, 0);
|
||||||
free(dnd); /* free the array of dnode pointers to the dirs */
|
free(dnd); /* free the array of dnode pointers to the dirs */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1129,7 +1132,7 @@ extern int ls_main(int argc, char **argv)
|
|||||||
#ifdef CONFIG_FEATURE_LS_SORTFILES
|
#ifdef CONFIG_FEATURE_LS_SORTFILES
|
||||||
shellsort(dnd, dndirs);
|
shellsort(dnd, dndirs);
|
||||||
#endif
|
#endif
|
||||||
showdirs(dnd, dndirs);
|
showdirs(dnd, dndirs, dnfiles == 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (status);
|
return (status);
|
||||||
|
Loading…
Reference in New Issue
Block a user