gowin: Himbaechel. Support DragonFlyBSD

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
This commit is contained in:
YRabbit 2023-09-16 15:01:24 +10:00 committed by myrtle
parent 8a54e5ec1c
commit f5996ff4a1

View File

@ -156,8 +156,7 @@ std::string proc_self_dirname(void)
{
char buf[PATH_MAX + 1] = "", *path, *p;
// if case argv[0] contains a valid path, return it
if (strlen(npnr_path) > 0) {
p = strrchr(npnr_path, '/');
if (strlen(npnr_path) > 0 && (p = strrchr(npnr_path, '/')) != NULL) {
snprintf(buf, sizeof buf, "%*s/", (int)(npnr_path - p), npnr_path);
return buf;
}