Project/Real_code/gnu/coreutils-5.0/src/ls.c
static inline int
cmp_extension (struct fileinfo const *a, struct fileinfo const *b,
	       int (*cmp) (char const *, char const *))
{
  char const *base1 = strrchr (a->name, '.');
  char const *base2 = strrchr (b->name, '.');
  int diff = cmp (base1 ? base1 : "", base2 ? base2 : "");
  return diff ? diff : cmp (a->name, b->name);
}
/* Compare file extensions.  Files with no extension are `smallest'.
   If extensions are the same, compare by filenames instead. */
Compare file extensions.  Files with no extension are `smallest'.
If extensions are the same, compare by filenames instead.
Compare file extensions . Files with no extension are ` smallest ' . If extensions are the same compare by filenames instead .
static inline int
cmp_extension (struct fileinfo const *a, struct fileinfo const *b,
	       int (*cmp) (char const *, char const *))
{
  char const *base1 = strrchr (a->name, '.');
  char const *base2 = strrchr (b->name, '.');
  int diff = cmp (base1 ? base1 : "", base2 ? base2 : "");
  return diff ? diff : cmp (a->name, b->name);
}
static inline int cmp_extension ( struct fileinfo const * a , struct fileinfo const * b , int ( * cmp ) ( char const * , char const * ) ) { char const * base1 = strrchr ( a -> name , ' ' ) ; char const * base2 = strrchr ( b -> name , ' ' ) ; int diff = cmp ( base1 ? base1 : " " , base2 ? base2 : " " ) ; return diff ? diff : cmp ( a -> name , b -> name ) ; }
Compare file extensions.
Compare file extensions .