mailing list of musl libc
 help / color / mirror / code / Atom feed
bab3e64b9916d74cbcbbc1aacf585b2b14550ad7 blob 742 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 
/*
 * Based on an implementation by Brad Conroy (technosaurus) 
 * published on the Puppy Linux forums.
 *
 * This work is released to the Public Domain.
 * In locales that do not recognize public domain it is:
 * Copyright Brad Conroy 2012, permission is hereby granted to use this work in
 * accordance with any license approved by the Open Source Initiative for any 
 * purpose without restriction in perpetuity.
 */
#include <string.h>

int strverscmp(const char *l, const char *r)
{
	int ret=0, buf=0;
	while ( *l && *r && l[0]==r[0] ) {
		l++;
		r++;
	}
	do {
		ret=(10 * ret) + l++[0] - '0'; 
	} while ( '0' <= l[0] && l[0] <= '9') ;
	do {
		buf=(10 * buf) + r++[0] - '0'; 
	} while ( '0' <= r[0] && r[0] <= '9');
	return ret - buf;
}
debug log:

solving bab3e64 ...
found bab3e64 in https://inbox.vuxu.org/musl/20121205110959.87b6111a.idunham@lavabit.com/
found 7054967 in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 7054967837f895301d5472ec9303ff63905db6ed	src/string/strverscmp.c

applying [1/1] https://inbox.vuxu.org/musl/20121205110959.87b6111a.idunham@lavabit.com/
diff --git a/src/string/strverscmp.c b/src/string/strverscmp.c
index 7054967..bab3e64 100644

1:7: trailing whitespace.
 * Based on an implementation by Brad Conroy (technosaurus) 
1:13: trailing whitespace.
 * accordance with any license approved by the Open Source Initiative for any 
1:28: trailing whitespace.
		ret=(10 * ret) + l++[0] - '0'; 
1:31: trailing whitespace.
		buf=(10 * buf) + r++[0] - '0'; 
Checking patch src/string/strverscmp.c...
Applied patch src/string/strverscmp.c cleanly.
warning: 4 lines add whitespace errors.

index at:
100644 bab3e64b9916d74cbcbbc1aacf585b2b14550ad7	src/string/strverscmp.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).