Ticket #56: rpm-tilde-support.diff
| File rpm-tilde-support.diff, 1.7 kB (added by jengelh, 9 months ago) |
|---|
-
a/lib/rpmvercmp.c
old new 33 33 34 34 /* loop through each version segment of str1 and str2 and compare them */ 35 35 while (*one && *two) { 36 while (*one && !risalnum(*one) ) one++;37 while (*two && !risalnum(*two) ) two++;36 while (*one && !risalnum(*one) && *one != '~') one++; 37 while (*two && !risalnum(*two) && *two != '~') two++; 38 38 39 39 /* If we ran to the end of either, we are finished with the loop */ 40 40 if (!(*one && *two)) break; 41 41 42 /* If exactly one side has a tilde, it is decided. */ 43 if ((*one == '~') ^ (*two == '~')) 44 break; 45 42 46 str1 = one; 43 47 str2 = two; 44 48 … … 103 107 /* this catches the case where all numeric and alpha segments have */ 104 108 /* compared identically but the segment sepparating characters were */ 105 109 /* different */ 110 if (*two == '~') 111 return 1; 112 else if (*one == '~') 113 return -1; 114 106 115 if ((!*one) && (!*two)) return 0; 107 116 108 117 /* whichever version still has characters left over wins */

