Staging
v0.5.1
https://github.com/python/cpython
Revision 85b19831218b8be9cfb7dbab7ea475feeeac14ab authored by Brett Cannon on 18 December 2004, 21:09:04 UTC, committed by Brett Cannon on 18 December 2004, 21:09:04 UTC
1 parent 3497a04
Raw File
Tip revision: 85b19831218b8be9cfb7dbab7ea475feeeac14ab authored by Brett Cannon on 18 December 2004, 21:09:04 UTC
Backport of fix for bug #1083645; skip test_imp if threading is not available.
Tip revision: 85b1983
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