cvs: /php4/ext/standard array.c
| From: | Andrei Zmievski | Date: | Fri, 28 Apr 2000 14:01:39 +0000 |
| Subject: | cvs: /php4/ext/standard array.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-14148@lists.php.net to get a copy of this message | ||
andrei Fri Apr 28 07:01:39 2000 EDT
Modified files:
/php4/ext/standard array.c
Log:
Fix an empty arrays condition and optimize a bit.
@ Fixed a crash in array_multisort() that happened when empty arrays
@ were passed to it. (Andrei)
Index: php4/ext/standard/array.c
diff -u php4/ext/standard/array.c:1.39 php4/ext/standard/array.c:1.40
--- php4/ext/standard/array.c:1.39 Thu Apr 13 11:57:37 2000
+++ php4/ext/standard/array.c Fri Apr 28 07:01:08 2000
@@ -2152,6 +2152,15 @@
}
}
+ /* If all arrays are empty or have only one entry,
+ we don't need to do anything. */
+ if (array_size < 1) {
+ efree(ARRAYG(multisort_flags));
+ efree(arrays);
+ efree(args);
+ RETURN_TRUE;
+ }
+
/* Create the indirection array. This array is of size MxN, where
M is the number of entries in each input array and N is the number
of the input arrays + 1. The last column is NULL to indicate the end