README.md
1Compare version strings:
2
3This function compares strings S1 and S2:
4
51. By PREFIX in the same way as strcmp.
62. Then by VERSION (most similarly to version compare of Debian's dpkg).
7 Leading zeros in version numbers are ignored.
83. If both (PREFIX and VERSION) are equal, strcmp function is used for
9 comparison. So this function can return 0 if (and only if) strings S1
10 and S2 are identical.
11
12It returns number >0 for S1 > S2, 0 for S1 == S2 and number <0 for S1 < S2.
13
14This function compares strings, in a way that if VER1 and VER2 are version
15numbers and PREFIX and SUFFIX (SUFFIX defined as `(\.[A-Za-z~][A-Za-z0-9~]*)*)`
16are strings then VER1 < VER2 implies filevercmp (PREFIX VER1 SUFFIX,
17PREFIX VER2 SUFFIX) < 0.
18
19This function is intended to be a replacement for strverscmp.
20
21*fine print*
22
23
24 Copyright (C) 1995 Ian Jackson <iwj10@cus.cam.ac.uk>
25 Copyright (C) 2001 Anthony Towns <aj@azure.humbug.org.au>
26 Copyright (C) 2008-2009 Free Software Foundation, Inc.
27
28 This program is free software: you can redistribute it and/or modify
29 it under the terms of the GNU General Public License as published by
30 the Free Software Foundation, either version 3 of the License, or
31 (at your option) any later version.
32
33 This program is distributed in the hope that it will be useful,
34 but WITHOUT ANY WARRANTY; without even the implied warranty of
35 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 GNU General Public License for more details.
37
38 You should have received a copy of the GNU General Public License
39 along with this program. If not, see <http://www.gnu.org/licenses/>.
40