Staging
v0.5.1
https://github.com/python/cpython
Revision ae590db3ce8cd583f1f14fbb498f45d095b6d262 authored by Guido van Rossum on 07 October 1997, 14:48:23 UTC, committed by Guido van Rossum on 07 October 1997, 14:48:23 UTC
(Why isn't this file identical to ntpath.py?)
1 parent abfdd70
Raw File
Tip revision: ae590db3ce8cd583f1f14fbb498f45d095b6d262 authored by Guido van Rossum on 07 October 1997, 14:48:23 UTC
Fix join to support multiple arguments.
Tip revision: ae590db
strdup.c
/* strdup() replacement (from stdwin, if you must know) */

#include "config.h"
#include "myproto.h"
#include "mymalloc.h"

#include <string.h>

char *
strdup(str)
	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