MCPcopy Create free account
hub / github.com/coreutils/coreutils / cmp_extension

Function cmp_extension

src/ls.c:3853–3861  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3851 If extensions are the same, compare by file names instead. */
3852
3853static int
3854cmp_extension (struct fileinfo const *a, struct fileinfo const *b,
3855 int (*cmp) (char const *, char const *))
3856{
3857 char const *base1 = strrchr (a->name, '.');
3858 char const *base2 = strrchr (b->name, '.');
3859 int diff = cmp (base1 ? base1 : "", base2 ? base2 : "");
3860 return diff ? diff : cmp (a->name, b->name);
3861}
3862
3863/* Return the (cached) screen width,
3864 for the NAME associated with the passed fileinfo F. */

Callers

nothing calls this directly

Calls 1

cmpFunction · 0.85

Tested by

no test coverage detected