Staging
v0.5.1
https://github.com/python/cpython
Revision 956597f4ef4ef4c65b0a5a7e488757d865832a0e authored by Andrew M. Kuchling on 29 July 2006, 18:14:07 UTC, committed by Andrew M. Kuchling on 29 July 2006, 18:14:07 UTC
We want to encourage users to write open() when opening a file, but
open() was described with a single paragraph and
'file' had lots of explanation of the mode and bufsize arguments.

I've shrunk the description of 'file' to cross-reference to the 'File
objects' section, and to open() for an explanation of the arguments.

open() now has all the paragraphs about the mode string.  The bufsize
argument was moved up so that it isn't buried at the end; now there's
1 paragraph on mode, 1 on bufsize, and then 3 more on mode.  Various
other edits and rearrangements were made in the process.

It's probably best to read the final text and not to try to make sense
of the diffs.
1 parent fbdeaad
Raw File
Tip revision: 956597f4ef4ef4c65b0a5a7e488757d865832a0e authored by Andrew M. Kuchling on 29 July 2006, 18:14:07 UTC
Reorganize the docs for 'file' and 'open()' after some discussion with Fred.
Tip revision: 956597f
strdup.c
/* strdup() replacement (from stdwin, if you must know) */

#include "pgenheaders.h"

char *
strdup(const char *str)
{
	if (str != NULL) {
		register char *copy = malloc(strlen(str) + 1);
		if (copy != NULL)
			return strcpy(copy, str);
	}
	return NULL;
}
back to top