diff options
author | dwight <dwight@Dwights-MacBook.local> | 2008-08-24 19:21:52 -0400 |
---|---|---|
committer | dwight <dwight@Dwights-MacBook.local> | 2008-08-24 19:21:52 -0400 |
commit | 247764becc200dd4e4318e98fd67b4461d638205 (patch) | |
tree | 3bbb7161439d1c966ca64242ad80c536862f4baf | |
parent | f7acdf8f135e431522d3e0d577a4efa302b22d47 (diff) | |
parent | 5599f9ec699d64f1dc4c5813ec25f77c1b31c1ce (diff) | |
download | mongo-247764becc200dd4e4318e98fd67b4461d638205.tar.gz |
Merge branch 'master' of ssh://git.10gen.com/data/gitroot/p
-rw-r--r-- | db/db.cpp | 23 | ||||
-rw-r--r-- | db/javajs.cpp | 10 |
2 files changed, 24 insertions, 9 deletions
diff --git a/db/db.cpp b/db/db.cpp index 0960e5c9cbb..240a71c3480 100644 --- a/db/db.cpp +++ b/db/db.cpp @@ -767,16 +767,25 @@ void initAndListen(int listenPort, const char *dbPath, const char *appserverLoc #endif /* - * ensure that the dbpath ends w/ '/' as that's key in preventing things like - * /data/dbadmin.ns + * ensure that the dbpath ends with a path delim if not supplied + * @TODO - the following is embarassing - not sure of there's a clean way to + * find the platform delim */ + + char endchar = '/'; + char *endstr = "/"; + +#if defined(_WIN32) + endchar = '\\'; + endstr = "\\"; +#endif - if (dbPath && dbPath[strlen(dbPath)-1] != '/') { + if (dbPath && dbPath[strlen(dbPath)-1] != endchar) { char *t = (char *) malloc(strlen(dbPath) + 2); - - strcpy(t, dbPath); - strcat(t, "/"); - dbPath = t; + + strcpy(t, dbPath); + strcat(t, endstr); + dbPath = t; } dbpath = dbPath; diff --git a/db/javajs.cpp b/db/javajs.cpp index 730bb8f29d2..7856b69d9f9 100644 --- a/db/javajs.cpp +++ b/db/javajs.cpp @@ -378,8 +378,14 @@ void jasserted(const char *msg, const char *file, unsigned line) { const char* findEd(const char *path) { #if defined(_WIN32) - log() << " WIN32 default : c:/l/ed/" << endl; - return "c:/l/ed"; + + if (!path) { + path = findEd(); + } + + // @TODO check validity + + return path; #else if (!path) { |