- summary: Native ls globbing doesn't scale --> Native getdir - globbing doesn't behave correctly
Running the native "ls" command causes a loop in the output produced. This is only apparent with many files in the directory being listed. Listing the files in the cmd subdirectory will be fine if only "ls" has been built (27 files), but loops if everything has been built (270 files).
The issue is down in the glue_getdir() wrapper, and looks like it is to do with the sorting order. The glob(3c) man page states that the information will be sorted according to LC_COLLATE (although I'm not 100% convinced), but the filtering in glue_getdir assumes a pure ASCII ordering. The point of breakage is around the sh-backup.c file (which is truncated to 8.3 filename "sh-backu.c"). I think this is due to the sort ordering of null as compared with '-' character in the default locale vs. the sort ordering of the same under strncmp().