diff options
| author | Pieter Wuille <[email protected]> | 2012-04-09 23:50:56 +0200 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2012-04-11 22:30:23 +0200 |
| commit | ee12c3d60c4bb7b25e06709e92344d2d8b2c581e (patch) | |
| tree | 1928de3b16dfd343ce00c0f79b2fb2dd70a914ee /src/main.cpp | |
| parent | Merge pull request #1083 from laanwj/2012_04_connectionicon (diff) | |
| download | discoin-ee12c3d60c4bb7b25e06709e92344d2d8b2c581e.tar.xz discoin-ee12c3d60c4bb7b25e06709e92344d2d8b2c581e.zip | |
Use filesystem::path instead of manual string tinkering
Where possible, use boost::filesystem::path instead of std::string or
char* for filenames. This avoids a lot of manual string tinkering, in
favor of path::operator/.
GetDataDir is also reworked significantly, it now only keeps two cached
directory names (the network-specific data dir, and the root data dir),
which are decided through a parameter instead of pre-initialized global
variables.
Finally, remove the "upgrade from 0.1.5" case where a debug.log in the
current directory has to be removed.
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 3fe073247..b9c9db7a6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1822,7 +1822,7 @@ FILE* OpenBlockFile(unsigned int nFile, unsigned int nBlockPos, const char* pszM { if (nFile == -1) return NULL; - FILE* file = fopen(strprintf("%s/blk%04d.dat", GetDataDir().c_str(), nFile).c_str(), pszMode); + FILE* file = fopen((GetDataDir() / strprintf("blk%04d.dat", nFile)).string().c_str(), pszMode); if (!file) return NULL; if (nBlockPos != 0 && !strchr(pszMode, 'a') && !strchr(pszMode, 'w')) |