summaryrefslogtreecommitdiffstats
path: root/Objects/stringobject.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Michael Hudson <mwh21@cam.ac.uk>:Fred Drake2000-06-011-1/+3
| | | | | Removed PyErr_BadArgument() calls and replaced them with more useful error messages.
* Trent Mick:Guido van Rossum2000-05-081-5/+9
| | | | | | | | | | | | | | | | Fix the string methods that implement slice-like semantics with optional args (count, find, endswith, etc.) to properly handle indeces outside [INT_MIN, INT_MAX]. Previously the "i" formatter for PyArg_ParseTuple was used to get the indices. These could overflow. This patch changes the string methods to use the "O&" formatter with the slice_index() function from ceval.c which is used to do the same job for Python code slices (e.g. 'abcabcabc'[0:1000000000L]). slice_index() is renamed _PyEval_SliceIndex() and is now exported. As well, the return values for success/fail were changed to make slice_index directly usable as required by the "O&" formatter. [GvR: shouldn't a similar patch be applied to unicodeobject.c?]
* The methods islower(), isupper(), isspace(), isdigit() and istitle()Guido van Rossum2000-05-051-11/+11
| | | | | | gave bogus results for chars in the range 128-255, because their implementation was using signed characters. Fixed this by using unsigned character pointers (as opposed to using Py_CHARMASK()).
* Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum2000-05-031-21/+19
| | | | | | | | | | For more comments, read the patches@python.org archives. For documentation read the comments in mymalloc.h and objimpl.h. (This is not exactly what Vladimir posted to the patches list; I've made a few changes, and Vladimir sent me a fix in private email for a problem that only occurs in debug mode. I'm also holding back on his change to main.c, which seems unnecessary to me.)
* Marc-Andre Lemburg:Guido van Rossum2000-04-111-11/+14
| | | | | | | | | The maxsplit functionality in .splitlines() was replaced by the keepends functionality which allows keeping the line end markers together with the string. Added support for '%r' % obj: this inserts repr(obj) rather than str(obj).
* Marc-Andre Lemburg:Guido van Rossum2000-04-101-3/+52
| | | | | | | | | | | | | * string_contains now calls PyUnicode_Contains() only when the other operand is a Unicode string (not whenever it's not a string). * New format style '%r' inserts repr(arg) instead of str(arg). * '...%s...' % u"abc" now coerces to Unicode just like string methods. Care is taken not to reevaluate already formatted arguments -- only the first Unicode object appearing in the argument mapping is looked up twice. Added test cases for this to test_unicode.py.
* On 17-Mar-2000, Marc-Andre Lemburg said:Barry Warsaw2000-03-201-2/+2
| | | | | | | | | | | | | Attached you find an update of the Unicode implementation. The patch is against the current CVS version. I would appreciate if someone with CVS checkin permissions could check the changes in. The patch contains all bugs and patches sent this week and also fixes a leak in the codecs code and a bug in the free list code for Unicode objects (which only shows up when compiling Python with Py_DEBUG; thanks to MarkH for spotting this one).
* Fix typo in replace() detected by Mark Hammond and fixed by Marc-Andre.Guido van Rossum2000-03-131-2/+4
|
* Many changes for Unicode, by Marc-Andre Lemburg.Guido van Rossum2000-03-101-162/+755
|
* Patch by Moshe Zadka: move the string special case from abstract.cGuido van Rossum2000-03-071-0/+22
| | | | | | here. [Patch modified by GvR to keep the original exception.]
* string_join(): Fix memory leaks discovered by Charles Waldman (and aBarry Warsaw2000-03-061-5/+15
| | | | few other paths through the function that leaked).
* Massive patch by Skip Montanaro to add ":name" to as manyGuido van Rossum2000-02-291-14/+14
| | | | PyArg_ParseTuple() format string arguments as possible.
* The rest of the changes by Trent Mick and Dale Nagata for warning-freeGuido van Rossum2000-01-201-4/+4
| | | | compilation on NT Alpha. Mostly added casts etc.
* do_strip(): Fixed cut-and-paste error; this function should check forBarry Warsaw1999-12-151-3/+1
| | | | zero arguments (found by Marc Lemburg).
* Mainlining the string_methods branch. See branch revision logBarry Warsaw1999-10-121-1/+1044
| | | | messages for specific changes.
* Fix bug discovered by John W. Shipman -- when the width of a formatGuido van Rossum1999-06-071-2/+4
| | | | | | | | specifier came from an int expression instead of a constant in the format, a negative width was truncated to zero instead of taken to mean the same as that negative constant plugged into the format. E.g. "(%*s)" % (-5, "foo") yielded "(foo)" while "(%-5s)" yields "(foo )". Now both yield the latter -- like sprintf() in C.
* Greg Stein: Implement the new bf_getcharbuffer function, indicatingGuido van Rossum1998-10-081-2/+18
| | | | that (as far as the data type is concerned!) this is character data.
* Typo reported by Greg Stein: "modifiable" is the correct spelling.Guido van Rossum1998-10-011-1/+1
|
* Should check that PyObject_Str() really returned a string!Guido van Rossum1998-06-091-0/+5
|
* Make new gcc -Wall happyGuido van Rossum1998-04-101-2/+4
|
* Patch submitted by Brad Howes (with one bug fixed by me): allowGuido van Rossum1997-09-081-8/+17
| | | | | | arbitrary nested parens in a %(...)X style format. #Also folded two lines and added more detail to the error message for #unsupported format character.
* Change the Fini function to only remove otherwise unreferenced stringsGuido van Rossum1997-08-051-6/+16
| | | | | | | | | | from the interned table. There are references in hard-to-find static variables all over the interpreter, and it's not worth trying to get rid of all those; but "uninterning" isn't fair either and may cause subtle failures later -- so we have to keep them in the interned table. Also get rid of no-longer-needed insert of None in interned dict.
* Added internal routine PyString_Fini() which deletes all internedGuido van Rossum1997-08-021-0/+18
| | | | strings. For use in Py_Finalize() only.
* Use #include "mymath.h" instead of declaring fabs() explicitly.Guido van Rossum1997-06-031-2/+1
| | | | This should solve a weird problem on the Mac for Jack.
* Checkin of Jack's buffer mods.Guido van Rossum1997-05-051-1/+41
| | | | Not really checked, but didn't fail any tests either...
* Quickly renamed the last directory.Guido van Rossum1997-05-021-190/+203
|
* Tweaks to keep the Microsoft compiler quiet.Guido van Rossum1997-04-091-1/+1
|
* Slight tweak: in string_hash(), if the hash hasn't been computed yet,Guido van Rossum1997-02-141-0/+5
| | | | | and if there's a pointer to an interned version of the string, use its hash and store its hash in this object, rather than recomputing it.
* Fix bug reported by Per Lindqvist: "%#06x" % 1 stuck the 0 paddingGuido van Rossum1997-01-291-1/+13
| | | | in front of the 0x, like such: "0000x1".
* Don't use static buffers internally for formatstring().Guido van Rossum1997-01-211-25/+26
|
* String interning.Guido van Rossum1997-01-181-0/+75
|
* Add const to error and newstring functionsGuido van Rossum1996-12-101-2/+2
|
* Make gcc -Wall happyGuido van Rossum1996-12-051-2/+2
|
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-13/+20
|
* Fixed compare function to do first char comparison in unsigned mode,Guido van Rossum1996-10-231-1/+1
| | | | for consistency with the way other characters are compared.
* Multiply by 1000003 instead of 3 in string hachGuido van Rossum1996-09-111-1/+1
|
* new debugger symbol namesGuido van Rossum1996-05-231-1/+1
|
* Plug memory leak in the previous fix :-(Guido van Rossum1996-05-211-1/+0
|
* Fix obscure bug in string%mapping where the mapping creates its itemsGuido van Rossum1996-05-211-21/+12
| | | | | on the fly -- there was an unsafe DECREF. Actually save some lines of code by using abstract.c:PyObject_GetItem().
* fix dusty debugging macrosGuido van Rossum1995-03-291-1/+1
|
* a few peephole optimizationsGuido van Rossum1995-03-091-1/+1
|
* don't complain about too many args if arg is a dictGuido van Rossum1995-02-271-1/+1
|
* use Py_CHARMASK; and don't check for neg. float to the float power hereGuido van Rossum1995-02-101-5/+5
|
* Added 1995 to copyright message.Guido van Rossum1995-01-041-2/+2
| | | | | floatobject.c: fix hash(). methodobject.c: support METH_FREENAME flag bit.
* Lots of minor changes. Note for mappingobject.c: the hash table pointerGuido van Rossum1995-01-021-1/+1
| | | | can now be NULL.
* * Include/classobject.h, Objects/classobject.c, Python/ceval.c:Guido van Rossum1994-09-281-1/+1
| | | | | | | | | | | | | | | | | | entirely redone operator overloading. The rules for class instances are now much more relaxed than for other built-in types (whose coerce must still return two objects of the same type) * Objects/floatobject.c: add overflow check when converting float to int and implement truncation towards zero using ceil/float * Objects/longobject.c: change ValueError to OverflowError when converting to int * Objects/rangeobject.c: modernized * Objects/stringobject.c: use HAVE_LIMITS instead of __STDC__ * Objects/xxobject.c: changed to use new style (not finished?)
* fix nasty bug in resizing (formatstring)Guido van Rossum1994-08-301-18/+98
|
* Fix the fix :-(Guido van Rossum1993-11-111-1/+3
|
* Three micro fixes to formatstringGuido van Rossum1993-11-111-5/+4
|
* Fixed bugs in resizetuple and extended the interface.Sjoerd Mullender1993-11-011-0/+10
| | | | | Added ifdefs in stringobject.c for shared strings of length 1. Renamed free_list in tupleobject.c to free_tuples.