Hi Bernd

TYPwiz creates an empty key 'CodePage=' in my styles_typ.txt every time i had
changed this file, this leads to an error message at the end of the build
process.


The error can be fixed in mkgmap and I've attached a patch to
do so.  I will commit this tomorrow as it is fairly straightforward.

Best wishes,
Steve
Index: src/uk/me/parabola/mkgmap/main/TypCompiler.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/uk/me/parabola/mkgmap/main/TypCompiler.java	(revision 4100)
+++ src/uk/me/parabola/mkgmap/main/TypCompiler.java	(date 1517590268000)
@@ -246,10 +246,11 @@
 					if (line.charAt(0) == 0xfeff)
 						return;
 
-					if (line.startsWith("CodePage")) {
+					if (line.startsWith("CodePage=")) {
 						String[] split = line.split("=");
 						try {
-							setCodePage("cp" + Integer.decode(split[1].trim()));
+							if (split.length > 1)
+								setCodePage("cp" + Integer.decode(split[1].trim()));
 						} catch (NumberFormatException e) {
 							setCodePage("cp1252");
 						}
Index: src/uk/me/parabola/mkgmap/typ/TypTextReader.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/uk/me/parabola/mkgmap/typ/TypTextReader.java	(revision 4100)
+++ src/uk/me/parabola/mkgmap/typ/TypTextReader.java	(date 1517591167000)
@@ -65,6 +65,9 @@
 					break;
 				}
 			} else {
+				if (currentSection == null)
+					throw new SyntaxException(scanner, "Missing section start");
+
 				// Line inside a section
 				String name = tok.getValue();
 
@@ -74,9 +77,6 @@
 
 				String value = scanner.readLine();
 
-				if (currentSection == null)
-					throw new SyntaxException(scanner, "Missing section start");
-
 				currentSection.processLine(scanner, name, value);
 			}
 			scanner.skipSpace();
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to