I recently began work on bug 239765, and came across the wonder of FILE_PATHSEP: #ifdef XP_UNIX #define FILE_PATHSEP '/' #define FILE_PATHSEPP "/" #define FILE_PARENT "../" #define WSACleanup() #elif defined(XP_WIN32) #define FILE_PATHSEP '/' #define FILE_PATHSEPP "\\\\" #define FILE_PARENT "..\\" #endif /* XP_WIN32 */ Firstly, what little I knew about windows file handling told me that we could, at least on the supply side, use a unix /. Indeed, I noted that much of create_instance does exactly that *and* passes in FILE_PATHSEP via %c. If we needed FILE_PATHSEP, then this would already be a problem: /* generate <confdir>/slapd-collations.conf */ PR_snprintf(src, sizeof(src), "%s%c%s%c/config/%s-collations.conf", cf->sysconfdir, FILE_PATHSEP, cf->package_name, FILE_PATHSEP, PRODUCT_NAME); PR_snprintf(dest, sizeof(dest), "%s%c%s-collations.conf", cf->config_dir, FILE_PATHSEP, PRODUCT_NAME); Even more priceless is the use of FILE_PATHSEP in ldap/admin/src/configure_instance.cpp:create_console_script(). (is there a /bin/sh that doesn't accept / as a path?). Anyway, for my own amusement, I'll post a patch (probably untested on win32) to make this a little easier on the eyes, and perhaps even easier on new programmers to the codebase. Thoughts? Andrew Bartlett -- Andrew Bartlett http://samba.org/~abartlet/ Authentication Developer, Samba Team http://samba.org Samba Developer, Red Hat Inc. http://redhat.com
Attachment:
signature.asc
Description: This is a digitally signed message part
-- Fedora-directory-devel mailing list Fedora-directory-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/fedora-directory-devel