Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 282041 - app-admin/eselect-python fails to build on systems without strndup
Summary: app-admin/eselect-python fails to build on systems without strndup
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Other
: High normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-19 19:03 UTC by Fabian Groffen
Modified: 2009-08-19 19:09 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2009-08-19 19:03:21 UTC
patch follows
Comment 1 Fabian Groffen gentoo-dev 2009-08-19 19:04:55 UTC
relevant exerpt from prefix patch:

@@ -31,7 +31,11 @@
    const char* last_slash = strrchr(exe, '/');
    if (last_slash)
    {
-       return strndup(exe, last_slash - exe);
+       size_t len = last_slash - exe;
+       char *ret = malloc(sizeof(char) * (len + 1));
+       memcpy(ret, exe, len);
+       ret[len] = '\0';
+       return(ret);
    }
    const char* PATH = getenv("PATH");
    if (! PATH)
Comment 2 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2009-08-19 19:09:46 UTC
Fixed in r205.