File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ foreach ($special_forms as $f1) {
2222 test ("1.0 $ f1 " , "1.0 $ f2 " );
2323 }
2424}
25+ test ("1.2. " , "1.2. " );
26+ test ("1.2.. " , "1.2.. " );
27+
2528print "TESTING OPERATORS \n" ;
2629foreach ($ special_forms as $ f1 ) {
2730 foreach ($ special_forms as $ f2 ) {
@@ -106,6 +109,8 @@ TESTING COMPARE
1061091.0pl1 > 1.0rc1
1071101.0pl1 > 1.0
1081111.0pl1 = 1.0pl1
112+ 1.2. = 1.2.
113+ 1.2.. = 1.2..
109114TESTING OPERATORS
1101151.0-dev lt 1.0-dev : false
1111161.0-dev < 1.0-dev : false
Original file line number Diff line number Diff line change @@ -66,7 +66,15 @@ php_canonicalize_version(const char *version)
6666 }
6767 lp = * p ++ ;
6868 }
69- * q ++ = '\0' ;
69+
70+ /* Check if the last component is empty (i.e. the last character is a dot)
71+ * and remove it if it is. */
72+ if (* (q - 1 ) == '.' ) {
73+ * (q - 1 ) = '\0' ;
74+ } else {
75+ * q = '\0' ;
76+ }
77+
7078 return buf ;
7179}
7280
You can’t perform that action at this time.
0 commit comments