mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-06 06:58:15 +00:00
Merge branch 'fix/2228' of https://github.com/Adrijaned/aseprite into fix-2228
This commit is contained in:
commit
a19e317212
@ -613,37 +613,34 @@ again:
|
||||
}
|
||||
// else file-name specified in the entry is really a file to open...
|
||||
|
||||
// check if the filename doesn't contain slashes or other ilegal characters...
|
||||
bool has_invalid_char = (fn.find('/') != std::string::npos);
|
||||
#ifdef _WIN32
|
||||
has_invalid_char =
|
||||
has_invalid_char ||
|
||||
(fn.find('\\') != std::string::npos ||
|
||||
fn.find(':') != std::string::npos ||
|
||||
fn.find('*') != std::string::npos ||
|
||||
fn.find('?') != std::string::npos ||
|
||||
fn.find('\"') != std::string::npos ||
|
||||
fn.find('<') != std::string::npos ||
|
||||
fn.find('>') != std::string::npos ||
|
||||
fn.find('|') != std::string::npos);
|
||||
#endif
|
||||
if (has_invalid_char) {
|
||||
const char* invalid_chars =
|
||||
"/"
|
||||
#ifdef _WIN32
|
||||
" \\ : * ? \" < > |"
|
||||
#endif
|
||||
;
|
||||
// Check that the filename doesn't contain ilegal characters.
|
||||
// Linux allows all kind of characters, only '/' is disallowed,
|
||||
// but in that case we consider that a full path was entered in
|
||||
// the filename and we can enter to the full path folder.
|
||||
if (!enter_folder) {
|
||||
const bool has_invalid_char =
|
||||
(fn.find(':') != std::string::npos ||
|
||||
fn.find('*') != std::string::npos ||
|
||||
fn.find('?') != std::string::npos ||
|
||||
fn.find('\"') != std::string::npos ||
|
||||
fn.find('<') != std::string::npos ||
|
||||
fn.find('>') != std::string::npos ||
|
||||
fn.find('|') != std::string::npos);
|
||||
if (has_invalid_char) {
|
||||
const char* invalid_chars = "/ \\ : * ? \" < > |";
|
||||
|
||||
ui::Alert::show(
|
||||
fmt::format(
|
||||
Strings::alerts_invalid_chars_in_filename(),
|
||||
invalid_chars));
|
||||
ui::Alert::show(
|
||||
fmt::format(
|
||||
Strings::alerts_invalid_chars_in_filename(),
|
||||
invalid_chars));
|
||||
|
||||
// show the window again
|
||||
setVisible(true);
|
||||
goto again;
|
||||
// show the window again
|
||||
setVisible(true);
|
||||
goto again;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// does it not have extension? ...we should add the extension
|
||||
// selected in the filetype combo-box
|
||||
|
Loading…
Reference in New Issue
Block a user