Staging
v0.5.1
https://github.com/python/cpython
Revision e5f7dccefaa8d97ab53b3051acbb4a4d49379dc4 authored by Benjamin Peterson on 29 December 2017, 01:54:12 UTC, committed by GitHub on 29 December 2017, 01:54:12 UTC
1 parent e5681b9
Raw File
Tip revision: e5f7dccefaa8d97ab53b3051acbb4a4d49379dc4 authored by Benjamin Peterson on 29 December 2017, 01:54:12 UTC
make PatternCompiler use the packaged grammar if possible (more bpo-24960) (#5034)
Tip revision: e5f7dcc
strdup.c
/* strdup() replacement (from stdwin, if you must know) */

#include "pgenheaders.h"

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