2 * Copyright 1998 by Andi Kleen. Subject to the GPL.
3 * Copyright 2002 by Bruno Hall who contributed a shorter rewrite
6 * $Id: nstrcmp.c,v 1.3 2002/12/10 00:37:33 ecki Exp $
13 /* like strcmp(), but knows about numbers */
14 int nstrcmp(const char *a
, const char *b
)
16 while (*a
== *b
&& !isdigit(*a
)) {
21 if (isdigit(*a
) && isdigit(*b
))
22 return atoi(a
) - atoi(b
);
23 return *(const unsigned char *)a
- *(const unsigned char *)b
;