Skip to content

Commit

Permalink
Truncate absurdly long bookmark names.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pulkomandy committed Jun 16, 2014
1 parent 2b103ca commit 2860fec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/apps/webpositive/BrowserWindow.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 2860fec

Please sign in to comment.