aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer2array.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2007-04-05The massive copyright updateAvuton Olrich1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@5834 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-10-10buffer2array: extra unit tests (for PHP magic quote escapes)Eric Wong1-9/+21
Make the unit tests compile correctly without using xstrdup. Also, use "static inline" instead of "inline static": certain compilers or cflags are likely to complain about the latter. git-svn-id: https://svn.musicpd.org/mpd/trunk@4892 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-10-06put back np's supperrior buffer2array, and fix my bug fix from change 4872Warren Dukes1-100/+42
git-svn-id: https://svn.musicpd.org/mpd/trunk@4875 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-10-06Revert buffer2array() behavior back to tried and true 0.11.x versionEric Wong1-43/+100
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
2006-10-06fix escaping in quotes. (Now phpMp works again!)Warren Dukes1-12/+6
git-svn-id: https://svn.musicpd.org/mpd/trunk@4872 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-26Replace strdup and {c,re,m}alloc with x* variants to check for OOM errorsEric Wong1-6/+6
I'm checking for zero-size allocations and assert()-ing them, so we can more easily get backtraces and debug problems, but we'll also allow -DNDEBUG people to live on the edge if they wish. We do not rely on errno when checking for OOM errors because some implementations of malloc do not set it, and malloc is commonly overridden by userspace wrappers. I've spent some time looking through the source and didn't find any obvious places where we would explicitly allocate 0 bytes, so we shouldn't trip any of those assertions. We also avoid allocating zero bytes because C libraries don't handle this consistently (some return NULL, some not); and it's dangerous either way. git-svn-id: https://svn.musicpd.org/mpd/trunk@4690 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-06renamce cstrtok to buffer2array. please don't rename functions; especially ↵Warren Dukes1-10/+18
to names that look extremely std-lib-ish. also, don't use isspace, apparently it's local dependent and potentially consideres ' ' or '\t' not to be a space, or considers other characters to be a space. git-svn-id: https://svn.musicpd.org/mpd/trunk@4574 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-05buffer2array: more unit testsEric Wong1-0/+21
git-svn-id: https://svn.musicpd.org/mpd/trunk@4570 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-05buffer2array: fix for trailing sub-quoted text inside a quoted contextEric Wong1-2/+36
Also added a unit test to check for errors/bugs to make sure we don't have regressions. Bug found by Qball. git-svn-id: https://svn.musicpd.org/mpd/trunk@4569 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-03buffer2array: oops, we forgot to take into account that \ is escaped, tooEric Wong1-1/+2
Any escaped instances of \ must already be inside an already quoted string, though. git-svn-id: https://svn.musicpd.org/mpd/trunk@4539 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-29replace buffer2array() with cstrtok() from mpd-keEric Wong1-88/+32
This modifies the string in place, and does not allocate any memory from the heap. This is considerably smaller than the function it replaces, and will be instrumental in getting the commands/conf malloc reductions done. git-svn-id: https://svn.musicpd.org/mpd/trunk@4481 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-20Add mpd-indent.shAvuton Olrich1-40/+37
Indent the entire tree, hopefully we can keep it indented. git-svn-id: https://svn.musicpd.org/mpd/trunk@4410 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-14Change shank's email addressJ. Alexander Treuman1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4333 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-13Huge header update, update the copyright and addAvuton Olrich1-1/+1
the GPL header where necessary git-svn-id: https://svn.musicpd.org/mpd/trunk@4317 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-03todo updateWarren Dukes1-1/+0
git-svn-id: https://svn.musicpd.org/mpd/trunk@2499 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-04-14add vim shiznit to end of all source filesWarren Dukes1-0/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@750 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-03-31cleanup reading from interface, when argArrayLength returned by buffer2arrayWarren Dukes1-0/+8
is 0, we weren't dealing with this well at all! git-svn-id: https://svn.musicpd.org/mpd/trunk@559 09075e82-0dd4-0310-85a5-a0d7c8717e4f