in pathnames.
}
#endif
- if ( (myname = strrchr( argv[0], '/' )) == NULL )
+ if ( (myname = strrchr( argv[0], *LDAP_DIRSEP )) == NULL )
myname = strdup( argv[0] );
else
myname = strdup( myname + 1 );
int numto, ngroups, numerr, nargs;
int i, j;
- if ( (myname = strrchr( argv[0], '/' )) == NULL )
+ if ( (myname = strrchr( argv[0], *LDAP_DIRSEP )) == NULL )
myname = strdup( argv[0] );
else
myname = strdup( myname + 1 );
int i, j;
char *conffile = NULL;
- if ( (myname = strrchr( argv[0], '/' )) == NULL )
+ if ( (myname = strrchr( argv[0], *LDAP_DIRSEP )) == NULL )
myname = strdup( argv[0] );
else
myname = strdup( myname + 1 );
}
#else
fprintf( stderr, "%s: not compiled with SASL support\n",
- argv[0] );
+ prog );
return( EXIT_FAILURE );
#endif
}
}
#else
fprintf( stderr, "%s: not compiled with SASL support\n",
- argv[0] );
+ prog );
return( EXIT_FAILURE );
#endif
}
default:
fprintf( stderr, "%s: unrecognized option -%c\n",
prog, optopt );
- usage( argv[0] );
+ usage( prog );
return( EXIT_FAILURE );
}
}
} else if ( argc - optind != 0 ) {
fprintf( stderr, "%s: invalid number of arguments (%d), "
"only two allowed\n", prog, argc-optind );
- usage( argv[0] );
+ usage( prog );
return( EXIT_FAILURE );
}
}
#else
fprintf( stderr, "%s: not compiled with SASL support\n",
- argv[0] );
+ prog );
return( EXIT_FAILURE );
#endif
}
default:
fprintf( stderr, "%s: unrecognized option -%c\n",
prog, optopt );
- usage (argv[0]);
+ usage (prog);
}
}
}
if( argc - optind > 1 ) {
- usage( argv[0] );
+ usage( prog );
} else if ( argc - optind == 1 ) {
user = strdup( argv[optind] );
} else {
}
#else
fprintf( stderr, "%s: not compiled with SASL support\n",
- argv[0] );
+ prog );
return( EXIT_FAILURE );
#endif
}
#endif
#ifdef HAVE_MKSTEMP
- sprintf(entry_temp_file, "/tmp/udXXXXXX");
+ strcpy(entry_temp_file, LDAP_TMPDIR LDAP_DIRSEP "udXXXXXX");
tmpfd = mkstemp(entry_temp_file);
if (verbose) {
char *p;
- if (( p = strrchr( editor, '/' )) == NULL ) {
+ if (( p = strrchr( editor, *LDAP_DIRSEP )) == NULL ) {
p = editor;
} else {
++p;
/* we assume UNIX path syntax is used... */
/* try ~/file */
- sprintf(path, "%s/%s", home, file);
+ sprintf(path, "%s%s%s", home, LDAP_DIRSEP, file);
openldap_ldap_init_w_conf(path, 1);
/* try ~/.file */
- sprintf(path, "%s/.%s", home, file);
+ sprintf(path, "%s%s.%s", home, LDAP_DIRSEP, file);
openldap_ldap_init_w_conf(path, 1);
}
return -1;
}
- if( *p != *LDAP_DIRSEP ) {
+ /* we don't check for LDAP_DIRSEP since URLs should contain '/' */
+ if( *p != '/' ) {
/* skip over false root */
p++;
}
/* $Id: ucdata.c,v 1.4 2001/01/02 18:46:20 mleisher Exp $" */
#include "portable.h"
+#include "ldap_config.h"
#include <stdio.h>
#include <stdlib.h>
#include "ucdata.h"
-#ifdef WIN32
-#define UC_DIRSEP '\\'
-#else
-#define UC_DIRSEP '/'
-#endif
-
/**************************************************************************
*
* Miscellaneous types, data, and support functions.
pp = path;
while (*dp && *dp != ':')
*pp++ = *dp++;
- *pp++ = UC_DIRSEP;
+ *pp++ = *LDAP_DIRSEP;
fp = filename;
while (*fp)
/* $Id: ucgendat.c,v 1.4 2001/01/02 18:46:20 mleisher Exp $" */
#include "portable.h"
+#include "ldap_config.h"
#include <stdio.h>
#include <stdlib.h>
/*
* Open the ctype.dat file.
*/
- sprintf(path, "%s/ctype.dat", opath);
+ sprintf(path, "%s%sctype.dat", opath, LDAP_DIRSEP);
if ((out = fopen(path, "wb")) == 0)
return;
/*
* Open the case.dat file.
*/
- sprintf(path, "%s/case.dat", opath);
+ sprintf(path, "%s%scase.dat", opath, LDAP_DIRSEP);
if ((out = fopen(path, "wb")) == 0)
return;
/*
* Open the comp.dat file.
*/
- sprintf(path, "%s/comp.dat", opath);
+ sprintf(path, "%s%scomp.dat", opath, LDAP_DIRSEP);
if ((out = fopen(path, "wb")) == 0)
return;
/*
* Open the decomp.dat file.
*/
- sprintf(path, "%s/decomp.dat", opath);
+ sprintf(path, "%s%sdecomp.dat", opath, LDAP_DIRSEP);
if ((out = fopen(path, "wb")) == 0)
return;
/*
* Open the cmbcl.dat file.
*/
- sprintf(path, "%s/cmbcl.dat", opath);
+ sprintf(path, "%s%scmbcl.dat", opath, LDAP_DIRSEP);
if ((out = fopen(path, "wb")) == 0)
return;
/*
* Open the num.dat file.
*/
- sprintf(path, "%s/num.dat", opath);
+ sprintf(path, "%s%snum.dat", opath, LDAP_DIRSEP);
if ((out = fopen(path, "wb")) == 0)
return;
FILE *in;
char *prog, *opath;
- if ((prog = strrchr(argv[0], '/')) != 0)
+ if ((prog = strrchr(argv[0], *LDAP_DIRSEP)) != 0)
prog++;
else
prog = argv[0];