summaryrefslogtreecommitdiffstats
path: root/Modules/stropmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototypeMark Hammond2002-08-021-1/+1
| | | | | | for Py_Main(). Thanks to Kalle Svensson and Skip Montanaro for the patches.
* Patch #568124: Add doc string macros.Martin v. Löwis2002-06-131-43/+43
|
* Repair widespread misuse of _PyString_Resize. Since it's clear peopleTim Peters2002-04-271-15/+6
| | | | | | | | | | | | | | | | | | | | | | don't understand how this function works, also beefed up the docs. The most common usage error is of this form (often spread out across gotos): if (_PyString_Resize(&s, n) < 0) { Py_DECREF(s); s = NULL; goto outtahere; } The error is that if _PyString_Resize runs out of memory, it automatically decrefs the input string object s (which also deallocates it, since its refcount must be 1 upon entry), and sets s to NULL. So if the "if" branch ever triggers, it's an error to call Py_DECREF(s): s is already NULL! A correct way to write the above is the simpler (and intended) if (_PyString_Resize(&s, n) < 0) goto outtahere; Bugfix candidate.
* Get rid of more PyArg_Parse & METH_OLDARGS.Neal Norwitz2002-04-021-12/+12
| | | | | PyArg_Parse( "s" ) -> PyString_AsString PyArg_Parse( "t#" ) -> PyString_AsStringAndSize
* Use the PyModule_Add*() APIs instead of manipulating the module dictFred Drake2002-04-011-14/+8
| | | | directly.
* Remove compiler warnings on Solaris 8.Neal Norwitz2002-03-201-1/+1
| | | | Can go into 2.2.x, but not necessary.
* More sprintf -> PyOS_snprintf.Tim Peters2001-11-281-2/+4
|
* sprintf -> PyOS_snprintf in some "obviously safe" cases.Tim Peters2001-11-281-3/+6
| | | | | Also changed <>-style #includes to ""-style in some places where the former didn't make sense.
* Add warnings to the strop module, for to those functions that reallyGuido van Rossum2001-05-151-0/+22
| | | | | | | | | *are* obsolete; three variables and the maketrans() function are not (yet) obsolete. Add a compensating warnings.filterwarnings() call to test_strop.py. Add this to the NEWS.
* Guido has Spoken. Restore strop.replace()'s treatment of a 0 count asTim Peters2001-05-101-0/+6
| | | | | | | meaning infinity -- but at least warn about it in the code! I pissed away a couple hours on this today, and don't wish the same on the next in line. Bugfix candidate.
* The strop module and test_strop.py believe replace() with a 0 countTim Peters2001-05-101-1/+1
| | | | | | | means "replace everything". But the string module, string.replace() amd test_string.py believe a 0 count means "replace nothing". "Nothing" wins, strop loses. Bugfix candidate.
* Heh. I need a break. After this: stropmodule & stringobject were moreTim Peters2001-05-101-8/+6
| | | | | | out of synch than I realized, and I managed to break replace's "count" argument when it was 0. All is well again. Maybe. Bugfix candidate.
* Fudge. stropmodule and stringobject both had copies of the buggyTim Peters2001-05-101-8/+13
| | | | | | mymemXXX stuff, and they were already out of synch. Fix the remaining bugs in both and get them back in synch. Bugfix release candidate.
* SF bug #422088: [OSF1 alpha] string.replace().Tim Peters2001-05-091-26/+33
| | | | | | Platform blew up on "123".replace("123", ""). Michael Hudson pinned the blame on platform malloc(0) returning NULL. This is a candidate for all bugfix releases.
* Mechanical changes for easier edits.Tim Peters2001-05-091-152/+136
|
* Rationalize use of limits.h, moving the inclusion to Python.h.Fred Drake2000-09-261-6/+0
| | | | | | | | Add definitions of INT_MAX and LONG_MAX to pyport.h. Remove includes of limits.h and conditional definitions of INT_MAX and LONG_MAX elsewhere. This closes SourceForge patch #101659 and bug #115323.
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
| | | | This should match the situation in the 1.6b1 tree.
* Do the absolute minimal amount of modifications to eradicateBarry Warsaw2000-09-011-3/+0
| | | | | | | | | | | | | | | Py_FatalError() from module initialization functions. The importing mechanism already checks for PyErr_Occurred() after module importation and it Does The Right Thing. Unfortunately, the following either were not compiled or tested by the regression suite, due to issues with my development platform: almodule.c cdmodule.c mpzmodule.c puremodule.c timingmodule.c
* Use METH_OLDARGS instead of numeric constant 0 in method def. tablesAndrew M. Kuchling2000-08-031-7/+14
|
* Use METH_VARARGS instead of numeric constant 1 in method def. tablesAndrew M. Kuchling2000-08-031-14/+28
|
* Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)',Thomas Wouters2000-07-211-1/+1
| | | | | | | | | | | | | | | | | | and a couple of functions that were missed in the previous batches. Not terribly tested, but very carefully scrutinized, three times. All these were found by the little findkrc.py that I posted to python-dev, which means there might be more lurking. Cases such as this: long func(a, b) long a; long b; /* flagword */ { and other cases where the last ; in the argument list isn't followed by a newline and an opening curly bracket. Regexps to catch all are welcome, of course ;)
* Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in eitherThomas Wouters2000-07-161-3/+3
| | | | | | | | | | comments, docstrings or error messages. I fixed two minor things in test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't"). There is a minor style issue involved: Guido seems to have preferred English grammar (behaviour, honour) in a couple places. This patch changes that to American, which is the more prominent style in the source. I prefer English myself, so if English is preferred, I'd be happy to supply a patch myself ;)
* replace PyXXX_Length calls with PyXXX_Size callsJeremy Hylton2000-07-121-1/+1
|
* ANSI-ficationPeter Schneider-Kamp2000-07-101-84/+24
|
* Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.Tim Peters2000-07-091-1/+1
|
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum2000-05-031-2/+2
| | | | | | | | | | 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.)
* On 17-Mar-2000, Marc-Andre Lemburg said:Barry Warsaw2000-03-201-1/+1
| | | | | | | | | | | | | 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).
* Massive patch by Skip Montanaro to add ":name" to as manyGuido van Rossum2000-02-291-12/+12
| | | | PyArg_ParseTuple() format string arguments as possible.
* split() docstring: Made signature and description for the firstFred Drake1999-11-041-3/+3
| | | | | parameter match. Error pointed out by François Pinard <pinard@iro.umontreal.ca> on c.l.py.
* In atoi(), don't use isxdigit() to test whether the last characterGuido van Rossum1999-02-221-1/+1
| | | | | | converted was a "digit" -- use isalnum(). This test is there only to guard against "+" or "-" being interpreted as a valid int literal. Reported by Takahiro Nakayama.
* expandtabs__doc__: blank line which was not terminated with \n\ causedBarry Warsaw1999-01-261-1/+0
| | | | the SunPro C compiler to choke. Removed this redundant line.
* A gift from Fredrik Lundh: fast C implementation of expandtabs().Guido van Rossum1999-01-251-0/+75
| | | | | I've reformatted it, added a few comments, a test for tabsize <= 0, and used the AS_STRING macro.
* Remove prototypes for PyOS_strto[u]l -- Chris Herborth.Guido van Rossum1998-12-101-3/+0
|
* Add DL_EXPORT() to all modules that could possibly be usedGuido van Rossum1998-12-041-1/+1
| | | | on BeOS or Windows.
* Add a missing DECREF in an error exit. Submitted by Jonathan Giddy.Guido van Rossum1998-10-191-0/+1
|
* Use the t# format where appropriate. Greg Stein.Guido van Rossum1998-10-081-13/+13
|
* Make gcc -Wall happy.Guido van Rossum1998-10-071-1/+1
|
* Andrew Dalke's implementation of string.count().Guido van Rossum1998-10-061-0/+47
|
* Better error messages when raising ValueError for int literals. (TheGuido van Rossum1998-08-041-8/+3
| | | | | previous version of this code would not show the offending input, even though there was code that attempted this.)
* Make sure that at least one digit has been consumed in atoi().Guido van Rossum1998-07-251-0/+4
|
* Make sure that no use of a function pointer gotten from aGuido van Rossum1998-05-221-3/+5
| | | | | tp_as_sequence or tp_as_mapping structure is made without checking it for NULL first.
* strop_replace(): balk if the pattern string is empty.Guido van Rossum1998-05-141-0/+4
|
* Check for boundary errors in [r]find -- find("x", "", 2) should return -1.Guido van Rossum1998-03-241-2/+2
|
* Forgot to return NULL in joinfields() when a type error was detectedGuido van Rossum1998-02-061-1/+3
| | | | in one of the sequence items.
* Oops, big glitch. Charles had put a 1 in the column for argument listGuido van Rossum1997-12-301-8/+8
| | | | | | | | type for all functions. However many function call PyArg_Parse() and need a 0. This is so that when they didn't change anything, the can do Py_INCREF(args); return args. Reverted this back. For atof(), there's no reason not to use PyArg_ParseTuple(), so I changed the code (atoi and atol already used that).
* Oops, the last checkin left a blank line in a string literal.Guido van Rossum1997-12-301-1/+1
|
* Minor editing corrections.Guido van Rossum1997-12-291-5/+6
|
* Added doc string, provided by Charles Waldman (with some reformattingGuido van Rossum1997-12-291-29/+162
| | | | and a little editing my me).