[PATCH] Cross-platform: progname: Made Path Seperator for Win

Thorsten Glaser tg at mirbsd.de
Sun Mar 4 23:34:00 UTC 2018


bprogyan at gmail.com dixit:

>+#if defined(_WIN32) || defined(__WIN32__)
>+        # define ENV_PATH_SEPERATOR '\\'

>-	last_slash = strrchr(progname, '/');
>+	last_slash = strrchr(progname, ENV_PATH_SEPERATOR);

No, Windows (and DOS and OS/2 and and and…) support both,
so on these platforms you have to use something like strcspn.

bye,
//mirabilos
-- 
Stéphane, I actually don’t block Googlemail, they’re just too utterly
stupid to successfully deliver to me (or anyone else using Greylisting
and not whitelisting their ranges). Same for a few other providers such
as Hotmail. Some spammers (Yahoo) I do block.


More information about the libbsd mailing list