Patch for version_compare() to fix bug #21611

From: Date: Mon, 04 Aug 2003 18:41:09 +0000
Subject: Patch for version_compare() to fix bug #21611
Groups: php.internals 
Request: Send a blank email to internals+get-3720@lists.php.net to get a copy of this message
Hello, Attached is a patch that makes version_compare() treat versions such as 4.0.1p1 like 4.0.1pl1. I know this version suffix isn't used by PHP, but there were some problems because PEAR packages used it, and i don't see any problem with version_compare() handling non-php versions as well. (Afaik, the "alpha" and "beta" suffixes are also not used, but they are in version_compare). -- Regards, Stefan Walk <swalk@prp.physik.tu-darmstadt.de>

Index: versioning.c =================================================================== RCS file: /repository/php-src/ext/standard/versioning.c,v retrieving revision 1.15 diff -u -r1.15 versioning.c --- versioning.c 10 Jun 2003 20:03:39 -0000 1.15 +++ versioning.c 4 Aug 2003 13:46:41 -0000 @@ -90,7 +90,7 @@ compare_special_version_forms(char *form1, char *form2) { int found1 = -1, found2 = -1; - special_forms_t special_forms[9] = { + special_forms_t special_forms[10] = { {"dev", 0}, {"alpha", 1}, {"a", 1}, @@ -99,6 +99,7 @@ {"RC", 3}, {"#", 4}, {"pl", 5}, + {"p", 5}, {NULL, 0}, }; special_forms_t *pp;
« previous php.internals (#3720) next »