From 5211a2ed0c185944b5348e42a4c494da129fe16a Mon Sep 17 00:00:00 2001 From: Nils <> Date: Sun, 17 May 2020 00:21:20 +0200 Subject: [PATCH] extra check for absolute paths --- qtgui/projectname.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qtgui/projectname.py b/qtgui/projectname.py index b608462..a9fc72b 100644 --- a/qtgui/projectname.py +++ b/qtgui/projectname.py @@ -80,7 +80,7 @@ class ProjectNameWidget(QtWidgets.QDialog): errorMessage = "" if currentText == "": errorMessage = QtCore.QCoreApplication.translate("ProjectNameWidget", "Name must not be empty.") - elif pathlib.PurePosixPath(path).match("/*"): + elif pathlib.PurePosixPath(path).match("/*") or str(pathlib.PurePosixPath(path)).startswith("/"): errorMessage = QtCore.QCoreApplication.translate("ProjectNameWidget", "Name must be a relative path.") elif pathlib.PurePosixPath(path).match("../*") or pathlib.PurePosixPath(path).match("*..*"): errorMessage = QtCore.QCoreApplication.translate("ProjectNameWidget", "Moving to parent directory not allowed.")