summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNiels Martin Hansen <nielsm@indvikleren.dk>2020-07-28 18:22:11 +0200
committerNiels Martin Hansen <nielsm@indvikleren.dk>2020-07-28 19:20:13 +0200
commit84efde8ee3ad0ce3bf816df98bb486dfc7e94989 (patch)
tree1946976303de11bfe3bac643c665f75a64cb0649 /src
parent3effad0beabe4a7ce4ddf5b55bab787e2d93fea3 (diff)
downloadopenttd-84efde8ee3ad0ce3bf816df98bb486dfc7e94989.tar.xz
Change: Log when rejecting a TAR archive for extraction
Based on report in <https://www.tt-forums.net/viewtopic.php?f=31&t=87374>
Diffstat (limited to 'src')
-rw-r--r--src/fileio.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fileio.cpp b/src/fileio.cpp
index 7340fa172..d40ca2136 100644
--- a/src/fileio.cpp
+++ b/src/fileio.cpp
@@ -929,7 +929,10 @@ bool ExtractTar(const char *tar_filename, Subdirectory subdir)
const char *dirname = (*it).second.dirname;
/* The file doesn't have a sub directory! */
- if (dirname == nullptr) return false;
+ if (dirname == nullptr) {
+ DEBUG(misc, 1, "Extracting %s failed; archive rejected, the contents must be in a sub directory", tar_filename);
+ return false;
+ }
char filename[MAX_PATH];
strecpy(filename, tar_filename, lastof(filename));