summaryrefslogtreecommitdiff
path: root/portato/eix/eix_utils.pyx
blob: 0ea9603d8017cc5990266c4463f367e97355bae1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
cdef char* strdup (char * other) except NULL:
    cdef size_t len
    cdef char* new

    if other is NULL:
        return NULL

    len = strlen(other)
    new = <char*>PyMem_Malloc(len+1)

    if new is NULL:
        raise MemoryError, "Malloc of new string copy"
        return NULL

    return strcpy(new, other)
1 2014-04-24tests: sed doesn't like escaped chars on non-gnuJason A. Donenfeld1-1/+1 2014-04-24tests: run from anywhereJason A. Donenfeld13-4/+16 2014-04-24Turns out aliases were a bad idea.Jason A. Donenfeld14-95/+92 2014-04-24Make gpg_opts an array.Jason A. Donenfeld1-12/+12 2014-04-24Shellcheck errors.Jason A. Donenfeld1-6/+6 2014-04-24tests: todo updateJason A. Donenfeld1-25/+0