* NAME: data->relstring() * DESCRIPTION: compare two strings as per MacOS for HFS */
| 403 | * DESCRIPTION: compare two strings as per MacOS for HFS |
| 404 | */ |
| 405 | int d_relstring(const char *str1, const char *str2) |
| 406 | { |
| 407 | register int diff; |
| 408 | |
| 409 | while (*str1 && *str2) |
| 410 | { |
| 411 | diff = hfs_charorder[(unsigned char) *str1] - |
| 412 | hfs_charorder[(unsigned char) *str2]; |
| 413 | |
| 414 | if (diff) |
| 415 | return diff; |
| 416 | |
| 417 | ++str1, ++str2; |
| 418 | } |
| 419 | |
| 420 | if (! *str1 && *str2) |
| 421 | return -1; |
| 422 | else if (*str1 && ! *str2) |
| 423 | return 1; |
| 424 | |
| 425 | return 0; |
| 426 | } |
| 427 | |
| 428 | /* |
| 429 | * NAME: calctzdiff() |
no outgoing calls
no test coverage detected