Mercurial > cpython-lru_cache-weakref
view Python/strdup.c @ 50307:e2bbbc06d92c legacy-trunk
Patch #4739 by David Laban: add symbols to pydoc help topics,
so that ``help('@')`` works as expected.
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Sat, 27 Dec 2008 18:20:04 +0000 |
| parents | f79434ee41fa |
| children | e7f6cef7a4cc |
line wrap: on
line source
/* 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; }
