int argc,
char *argv[] ));
+#ifdef _WIN32
+LDAP_LUTIL_F( void )
+lutil_slashpath LDAP_P(( char* path ));
+#define LUTIL_SLASHPATH(p) lutil_slashpath(p)
+#else
+#define LUTIL_SLASHPATH(p)
+#endif
+
LDAP_LUTIL_F( char* )
lutil_strcopy LDAP_P(( char *dst, const char *src ));
int _trans_argv = 1;
#endif
+#ifdef _WIN32
+/* Some Windows versions accept both forward and backslashes in
+ * directory paths, but we always use backslashes when generating
+ * and parsing...
+ */
+void lutil_slashpath( char *path )
+{
+ char *c, *p;
+
+ p = path;
+ while (( c=strchr( p, '/' ))) {
+ *c++ = '\\';
+ p = c;
+ }
+}
+#endif
+
char* lutil_progname( const char* name, int argc, char *argv[] )
{
char *progname;
_trans_argv = 0;
}
#endif
+ LUTIL_SLASHPATH( argv[0] );
progname = strrchr ( argv[0], *LDAP_DIRSEP );
progname = progname ? &progname[1] : argv[0];
-
return progname;
}