From 8b0b316565ddf0547f9d9996fa14eaeb1438c822 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 21 Feb 2024 13:51:40 +0100 Subject: [PATCH] Update unversal legal path rule for windows --- libs/ardour/utils.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc index 553fb0b5c1..9e06652fc4 100644 --- a/libs/ardour/utils.cc +++ b/libs/ardour/utils.cc @@ -117,7 +117,10 @@ ARDOUR::legalize_for_path (const string& str) string ARDOUR::legalize_for_universal_path (const string& str) { - return replace_chars (str, "<>:\"/\\|?*"); + string rv = replace_chars (str, "<>:\"/\\|?*"); + /* windows filenames can't end with ' ' or '.' */ + rv.erase (rv.find_last_not_of(" .") + 1); + return rv; } /** Legalize for a URI path component. This is like