X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/b72f24c7190fde1c15662d52c8d62789bd2086ad..aa9b77a56c302461e373cf447672aa93adff3130:/util.c diff --git a/util.c b/util.c index 11e4a9d9..b80d5161 100644 --- a/util.c +++ b/util.c @@ -653,3 +653,17 @@ int pop_dir(char *dir) return 0; } + +/* we need to supply our own strcmp function for file list comparisons + to ensure that signed/unsigned usage is consistent between machines. */ +int u_strcmp(const char *cs1, const char *cs2) +{ + const uchar *s1 = (uchar *)cs1; + const uchar *s2 = (uchar *)cs2; + + while (*s1 && *s2 && (*s1 == *s2)) { + s1++; s2++; + } + + return (int)*s1 - (int)*s2; +}