]> WPIA git - gigi.git/commitdiff
upd: fix to ensure that only comments are replaced
authorINOPIAE <m.maengel@inopiae.de>
Sat, 24 Aug 2019 12:16:34 +0000 (14:16 +0200)
committerINOPIAE <m.maengel@inopiae.de>
Sat, 24 Aug 2019 12:20:24 +0000 (14:20 +0200)
The current code replaces the "-" in "-----BEGIN CERTIFICATE-----" which
may be needed to have sample data for a certificate.

Change-Id: I5d364eba3003ea8e576dfcc9939cbaba2a1cca6a

src/club/wpia/gigi/database/SQLFileManager.java

index 3364924744e1e94bab48ab5cf664453c2cabf569..16f8fa21587b702081baf01a095111806005a3b2 100644 (file)
@@ -42,7 +42,7 @@ public class SQLFileManager {
                 }
             }
         }
-        sql = sql.replaceAll("--[^\n]*\n", "\n");
+        sql = sql.replaceAll("(^|\n)--[^\n]*\n", "\n");
         sql = sql.replaceAll("#[^\n]*\n", "\n");
         String[] stmts = sql.split(";");
         Pattern p = Pattern.compile("\\s*DROP TABLE IF EXISTS \"([^\"]+)\"");