From 33cabaf35d73086a91d7de7f333f42bf58e167b6 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Fri, 29 May 2020 15:56:59 +0200 Subject: [PATCH] fix trailing separator for optional index --- Global_Indexer/frmIndex.vb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Global_Indexer/frmIndex.vb b/Global_Indexer/frmIndex.vb index 9a8c917..eb0af3a 100644 --- a/Global_Indexer/frmIndex.vb +++ b/Global_Indexer/frmIndex.vb @@ -520,7 +520,14 @@ Public Class frmIndex oNamenkonvention = oNamenkonvention.Replace(oElement.Value, oManValue) - NewFileString = oNamenkonvention + Dim oFilenameWithoutExtension = Path.GetFileNameWithoutExtension(oNamenkonvention) + Dim oExtension = Path.GetExtension(oNamenkonvention) + + If oFilenameWithoutExtension.EndsWith("-") Or oFilenameWithoutExtension.EndsWith("_") Then + oFilenameWithoutExtension = oFilenameWithoutExtension.Substring(0, oFilenameWithoutExtension.Count - 1) + End If + + NewFileString = oFilenameWithoutExtension & oExtension sql_history_INSERT_INTO = sql_history_INSERT_INTO & ", INDEX" & AnzahlIndexe.ToString AnzahlIndexe += 1 sql_history_Index_Values = sql_history_Index_Values & ", '" & oManValue.Replace("'", "''") & "'"