Update to commit e2647ad952b4d7afc9a186429c181efbc4958786
[inform.git] / src / text.c
index 31612387929280e1516df021592ac09109cf2e4b..8a1ae31058614acefb4d4832484545d76eb9089b 100644 (file)
@@ -1,9 +1,8 @@
 /* ------------------------------------------------------------------------- */
 /*   "text" : Text translation, the abbreviations optimiser, the dictionary  */
 /*                                                                           */
-/* Copyright (c) Graham Nelson 1993 - 2020                                   */
-/*                                                                           */
-/* This file is part of Inform.                                              */
+/*   Part of Inform 6.35                                                     */
+/*   copyright (c) Graham Nelson 1993 - 2020                                 */
 /*                                                                           */
 /* Inform is free software: you can redistribute it and/or modify            */
 /* it under the terms of the GNU General Public License as published by      */
@@ -16,7 +15,7 @@
 /* GNU General Public License for more details.                              */
 /*                                                                           */
 /* You should have received a copy of the GNU General Public License         */
-/* along with Inform. If not, see https://gnu.org/licenses/                  */
+/* along with Inform. If not, see https://gnu.org/licenses/                  *
 /*                                                                           */
 /* ------------------------------------------------------------------------- */
 
@@ -1573,6 +1572,8 @@ static void dictionary_prepare_z(char *dword, uchar *optresult)
        applying to the text of dictionary entries: first produce a sequence
        of 6 (v3) or 9 (v4+) Z-characters                                     */
 
+    int dictsize = (version_number==3) ? 6 : 9;
+
     number_and_case = 0;
 
     for (i=0, j=0; dword[j]!=0; i++, j++)
@@ -1588,7 +1589,7 @@ to give number of dictionary word", dword);
             }
             break;
         }
-        if (i>=9) break;
+        if (i>=dictsize) break;
 
         k=(int) dword[j];
         if (k==(int) '\'')