From 80ac577deba20bc452d7cc3992bc068c49257e62 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 15 Aug 2014 00:28:36 -0400 Subject: basic check to make sure it even looks like a dump file --- crawl-ref/source/wiz-dump.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crawl-ref/source/wiz-dump.cc b/crawl-ref/source/wiz-dump.cc index fa27bc8468..e894746817 100644 --- a/crawl-ref/source/wiz-dump.cc +++ b/crawl-ref/source/wiz-dump.cc @@ -359,6 +359,10 @@ bool chardump_parser::_parse_from_file(const string &full_filename) if (f.eof()) return false; + string first_line = f.get_line(); + if (first_line.substr(0, 34) != " Dungeon Crawl Stone Soup version ") + return false; + while (!f.eof()) _modify_character(f.get_line()); -- cgit v1.2.3