Navigation Menu

Skip to content

Commit

Permalink
Change screenshot filename to one likely to work on all modern filesy…
Browse files Browse the repository at this point in the history
…stems

Fixes #2603
  • Loading branch information
Zeno- committed Apr 6, 2015
1 parent 8804c47 commit 43aab61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client.cpp
Expand Up @@ -1709,7 +1709,7 @@ void Client::makeScreenshot(IrrlichtDevice *device)
struct tm *tm = localtime(&t);

char timetstamp_c[64];
strftime(timetstamp_c, sizeof(timetstamp_c), "%FT%T", tm);
strftime(timetstamp_c, sizeof(timetstamp_c), "%Y%m%d_%H%M%S", tm);

std::string filename_base = g_settings->get("screenshot_path")
+ DIR_DELIM
Expand All @@ -1722,7 +1722,7 @@ void Client::makeScreenshot(IrrlichtDevice *device)
unsigned serial = 0;

while (serial < SCREENSHOT_MAX_SERIAL_TRIES) {
filename = filename_base + (serial > 0 ? ("-" + itos(serial)) : "") + filename_ext;
filename = filename_base + (serial > 0 ? ("_" + itos(serial)) : "") + filename_ext;
std::ifstream tmp(filename.c_str());
if (!tmp.good())
break; // File did not apparently exist, we'll go with it
Expand Down

0 comments on commit 43aab61

Please sign in to comment.