From 92994f6d71d406a5a8f4dae987557deab78bded6 Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 11 Jan 2020 08:45:45 -0800 Subject: [PATCH] data.base lookup fix Changing data.base lookup to accept leading spaces as an alternative to the normal leading tab ended up adding an invalid integrity check. Lines without any leading space or tab were considered to be in error but empty lines are present so need to be accepted. --- doc/fixes37.0 | 5 ++++- src/pager.c | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 4fc73a6cd..3443d41c8 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.60 $ $NHDT-Date: 1578690701 2020/01/10 21:11:41 $ +$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.61 $ $NHDT-Date: 1578761136 2020/01/11 16:45:36 $ General Fixes and Modified Features ----------------------------------- @@ -66,6 +66,9 @@ if running and Blind or Stunned or Fumbling or Dex < 10, encountering a closed door orthogonally would keep reporting "ouch! you bump into a door" repeatedly until eventually interrupted by approaching monster or hunger or ^C +data.base lookup of an entry with any blank lines would falsely claim that + "'data' file in wrong fromat or corrupted" after some extra checks + were added while investigating tab handling anomalies Platform- and/or Interface-Specific Fixes diff --git a/src/pager.c b/src/pager.c index 6781793e8..35548e6bd 100644 --- a/src/pager.c +++ b/src/pager.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 pager.c $NHDT-Date: 1578668022 2020/01/10 14:53:42 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.181 $ */ +/* NetHack 3.6 pager.c $NHDT-Date: 1578761137 2020/01/11 16:45:37 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.182 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2018. */ /* NetHack may be freely redistributed. See license for details. */ @@ -802,7 +802,7 @@ char *supplemental_name; do { ++tp; } while (tp < &tabbuf[8] && *tp == ' '); - } else { + } else if (*tp) { /* empty lines are ok */ goto bad_data_file; } /* if a tab after the leading one is found,