screenshot: Fix stripping suffix from relative filename
String.prototype.substr() doesn't support a negative length value (to subtract from the full length), so we end up with a filename of '' when hitting that code paths (a relative filename with '.png' suffix). Fix this by switching to String.prototype.replace() instead. https://gitlab.gnome.org/GNOME/gnome-shell/issues/2091
This commit is contained in:
parent
a8dcfa4656
commit
4c6a0678ff
@ -65,8 +65,7 @@ var ScreenshotService = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
*_resolveRelativeFilename(filename) {
|
*_resolveRelativeFilename(filename) {
|
||||||
if (GLib.str_has_suffix(filename, '.png'))
|
filename = filename.replace(/\.png$/, '');
|
||||||
filename = filename.substr(0, -4);
|
|
||||||
|
|
||||||
let path = [
|
let path = [
|
||||||
GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_PICTURES),
|
GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_PICTURES),
|
||||||
|
Loading…
Reference in New Issue
Block a user