# # patch "ChangeLog" # from [edbec96d7792c0b054ab9d6146fe664266557e46] # to [b8fa9964af69c487dd62346f1ab65d52847bbd8f] # # patch "tests/t_netsync_absorbs.at" # from [c5ce1765a2df526ca4f35030d82e34026d8c1923] # to [c34ed5130b13ac65b31983549c7a7c8882acbcba] # # patch "win32/fs.cc" # from [409c24f9c6ca1d1b9de8f951885c3044d16dfbd0] # to [db7e4a78e814041d51c08f6d997d66981d97ca42] # ======================================================================== --- ChangeLog edbec96d7792c0b054ab9d6146fe664266557e46 +++ ChangeLog b8fa9964af69c487dd62346f1ab65d52847bbd8f @@ -1,3 +1,10 @@ +2005-10-08 Matthew Gregan + + * win32/fs.cc: Don't consider USERPROFILE as a possible home + directory; APPDATA is more appropriate. Add a second method to + get the APPDATA path. + * tests/t_netsync_absorbs.at: Add missing CANONICALISE(). + 2005-10-07 Timothy Brownawell * commands.cc (pubkey): don't insist on having a database ======================================================================== --- tests/t_netsync_absorbs.at c5ce1765a2df526ca4f35030d82e34026d8c1923 +++ tests/t_netsync_absorbs.at c34ed5130b13ac65b31983549c7a7c8882acbcba @@ -9,6 +9,7 @@ AT_CHECK((echo address@hidden; echo address@hidden) | MONOTONE genkey address@hidden, [], [ignore], [ignore]) AT_CHECK(MONOTONE pubkey address@hidden, [], [stdout], [ignore]) +AT_CHECK(CANONICALISE(stdout)) AT_CHECK(cp stdout foo_public) NETSYNC_SERVE_START(address@hidden testbranch) ======================================================================== --- win32/fs.cc 409c24f9c6ca1d1b9de8f951885c3044d16dfbd0 +++ win32/fs.cc db7e4a78e814041d51c08f6d997d66981d97ca42 @@ -5,6 +5,9 @@ #include #include +#define WIN32_LEAN_AND_MEAN +#include +#include #include #include @@ -48,23 +51,26 @@ L(F("Home directory from MONOTONE_HOME\n")); return std::string(home); } - // If running under cygwin or mingw, try HOME next: + // Try HOME next: home = getenv("HOME"); - char * ostype = getenv("OSTYPE"); - if (home != NULL - && ostype != NULL - && (std::string(ostype) == "cygwin" || std::string(ostype) == "msys")) + if (home != NULL) { L(F("Home directory from HOME\n")); return std::string(home); } - // Otherwise, try USERPROFILE: - home = getenv("USERPROFILE"); + // Otherwise, try APPDATA: + home = getenv("APPDATA"); if (home != NULL) { - L(F("Home directory from USERPROFILE\n")); + L(F("Home directory from APPDATA\n")); return std::string(home); } + // Try a second method to get APPDATA: + TCHAR szPath[MAX_PATH]; + if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, szPath)) + { + return std::string(szPath); + } // Finally, if even that doesn't work (old version of Windows, I think?), // try the HOMEDRIVE/HOMEPATH combo: char * homedrive = getenv("HOMEDRIVE"); @@ -75,8 +81,8 @@ return std::string(homedrive) + std::string(homepath); } // And if things _still_ didn't work, give up. - N(false, F("could not find home directory (tried MONOTONE_HOME, HOME (if " - "cygwin/mingw), USERPROFILE, HOMEDRIVE/HOMEPATH")); + N(false, F("could not find home directory (tried MONOTONE_HOME, HOME, " + "APPDATA, HOMEDRIVE/HOMEPATH")); } utf8