From 2860fecc80acb8852d2ecc23f718ae5014986386 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Mon, 16 Jun 2014 17:05:42 +0200 Subject: [PATCH] Truncate absurdly long bookmark names. Fixes #9593. The complete name could be stored inside the file or as an additional attribute, but do we really need it? The bookmark menu will truncate it even further, anyway. --- src/apps/webpositive/BrowserWindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/apps/webpositive/BrowserWindow.cpp b/src/apps/webpositive/BrowserWindow.cpp index 8718a930ce2..e9d57ae597a 100644 --- a/src/apps/webpositive/BrowserWindow.cpp +++ b/src/apps/webpositive/BrowserWindow.cpp @@ -1817,8 +1817,9 @@ BrowserWindow::_CreateBookmark() bookmarkName.Remove(0, leafPos + 1); } // Make sure the bookmark title does not contain chars that are not - // allowed in file names. + // allowed in file names, and is within allowed name length. bookmarkName.ReplaceAll('/', '-'); + bookmarkName.Truncate(B_FILE_NAME_LENGTH - 1); // Check that the bookmark exists nowhere in the bookmark hierarchy, // though the intended file name must match, we don't search the stored