| 128 | |
| 129 | |
| 130 | static int |
| 131 | compare_left(const nat_char* a, const nat_char* b) |
| 132 | { |
| 133 | /* Compare two left-aligned numbers: the first to have a |
| 134 | different value wins. */ |
| 135 | for (;; a++, b++) { |
| 136 | if (!nat_isdigit(*a) && !nat_isdigit(*b)) |
| 137 | break; |
| 138 | else if (!nat_isdigit(*a)) |
| 139 | return -1; |
| 140 | else if (!nat_isdigit(*b)) |
| 141 | return +1; |
| 142 | else if (*a < *b) |
| 143 | return -1; |
| 144 | else if (*a > *b) |
| 145 | return +1; |
| 146 | } |
| 147 | |
| 148 | return 0; |
| 149 | } |
| 150 | |
| 151 | |
| 152 | static S32 strnatcmp0(const nat_char* a, const nat_char* b, S32 fold_case) |
no test coverage detected