summaryrefslogtreecommitdiff
path: root/lib/libalpm/version.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-08-23 01:47:45 -0500
committerDan McGee <dan@archlinux.org>2011-08-23 01:47:45 -0500
commitcc03d6366a12cd1926e46265c63fba98f41faaae (patch)
tree9d72ba66dc98b0b2030cd0fd7966a3463ad5da02 /lib/libalpm/version.c
parenta8a4395098b4ddced5204b386e476565e68508b5 (diff)
downloadpacman-cc03d6366a12cd1926e46265c63fba98f41faaae.tar.xz
Style-match rpmvercmp code with upstream
Not sure how or why some of this differed, but it is easy enough to set it back to how it was so it is easier to diff. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/version.c')
-rw-r--r--lib/libalpm/version.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/libalpm/version.c b/lib/libalpm/version.c
index 9f3a9b71..73d6a660 100644
--- a/lib/libalpm/version.c
+++ b/lib/libalpm/version.c
@@ -102,12 +102,12 @@ static int rpmvercmp(const char *a, const char *b)
two = str2;
/* loop through each version segment of str1 and str2 and compare them */
- while(*one && *two) {
- while(*one && !isalnum((int)*one)) one++;
- while(*two && !isalnum((int)*two)) two++;
+ while (*one && *two) {
+ while (*one && !isalnum((int)*one)) one++;
+ while (*two && !isalnum((int)*two)) two++;
/* If we ran to the end of either, we are finished with the loop */
- if(!(*one && *two)) break;
+ if (!(*one && *two)) break;
ptr1 = one;
ptr2 = two;
@@ -115,13 +115,13 @@ static int rpmvercmp(const char *a, const char *b)
/* grab first completely alpha or completely numeric segment */
/* leave one and two pointing to the start of the alpha or numeric */
/* segment and walk ptr1 and ptr2 to end of segment */
- if(isdigit((int)*ptr1)) {
- while(*ptr1 && isdigit((int)*ptr1)) ptr1++;
- while(*ptr2 && isdigit((int)*ptr2)) ptr2++;
+ if (isdigit((int)*ptr1)) {
+ while (*ptr1 && isdigit((int)*ptr1)) ptr1++;
+ while (*ptr2 && isdigit((int)*ptr2)) ptr2++;
isnum = 1;
} else {
- while(*ptr1 && isalpha((int)*ptr1)) ptr1++;
- while(*ptr2 && isalpha((int)*ptr2)) ptr2++;
+ while (*ptr1 && isalpha((int)*ptr1)) ptr1++;
+ while (*ptr2 && isalpha((int)*ptr2)) ptr2++;
isnum = 0;
}