From e3222d807a6178e0a4a5254b8443c3432b663efb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 6 Oct 2006 08:54:43 +0000 Subject: Revert buffer2array() behavior back to tried and true 0.11.x version Warren's fix in r4872 made phpMp work again, but also broke the unit tests completely (they work in this version). The version in 0.12.0 is far too buggy (it was from mpd-ke, what do you expect?). This one passes all the unit tests that the mpd-ke one passed, and should also work with phpMp when used with PHP magic quotes. This also means we can search on 100 (or more) tags at once, so no more arbitrary limits other than system memory. To run the unit tests, just do this: gcc -o t -DUNIT_TEST=1 src/buffer2array.c && ./t && echo OK git-svn-id: https://svn.musicpd.org/mpd/trunk@4874 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/buffer2array.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/buffer2array.h') diff --git a/src/buffer2array.h b/src/buffer2array.h index e12f0ceed..fa6882fd9 100644 --- a/src/buffer2array.h +++ b/src/buffer2array.h @@ -21,12 +21,8 @@ #include "../config.h" -/* tokenizes up to max elements in buffer (a null-terminated string) and - * stores the result in array (which must be capable of holding up to - * max elements). Tokenization is based on C string quoting rules. - * The arguments buffer and array are modified. - * Returns the number of elements tokenized. - */ -int buffer2array(char *buffer, char *array[], const int max); +int buffer2array(char *buffer, char ***array); + +void freeArgArray(char **array, int argArrayLength); #endif -- cgit v1.2.3