summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/initfile.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-17 07:19:04 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-17 07:19:04 +0000
commitae735f39601423c88be471340dfe88dc3d3d103d (patch)
tree6c70a5c28e9bb8202846737217ede5c0eaed2c13 /crawl-ref/source/initfile.cc
parentdf2a542d658cebfc151aff61d42abafd82de60c2 (diff)
downloadcrawl-ref-ae735f39601423c88be471340dfe88dc3d3d103d.tar.gz
crawl-ref-ae735f39601423c88be471340dfe88dc3d3d103d.zip
Fix 2017893: long file names not working on DOS. Crawl now takes a
shot at abbreviating them, and only fails if it can't find that file either. Handles all files included by default in /settings and /docs except changes.stone_soup which is not strictly necessary for the version information. Tested artificially by manually mutilating the file names; not actually tested on DOS. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6578 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/initfile.cc')
-rw-r--r--crawl-ref/source/initfile.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 08ca799cb2..f3e9beee74 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -2905,6 +2905,9 @@ std::string game_options::resolve_include(
// favoured file separator.
parent_file = canonicalise_file_separator(parent_file);
included_file = canonicalise_file_separator(included_file);
+#if defined(DOS)
+ get_dos_compatible_file_name(&included_file);
+#endif
// How we resolve include paths:
// 1. If it's an absolute path, use it directly.
@@ -2945,9 +2948,8 @@ std::string game_options::resolve_include(
return datafile_path(included_file, false, true);
}
-std::string game_options::resolve_include(
- const std::string &file,
- const char *type)
+std::string game_options::resolve_include( const std::string &file,
+ const char *type)
{
try
{
@@ -2955,9 +2957,11 @@ std::string game_options::resolve_include(
resolve_include(this->filename, file, &SysEnv.rcdirs);
if (resolved.empty())
+ {
report_error(
make_stringf("Cannot find %sfile \"%s\".",
type, file.c_str()));
+ }
return (resolved);
}
catch (const std::string &err)