mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 04:55:48 +03:00
Windows: Forbid chars 0-31 in filenames #6987
This commit is contained in:
parent
a72bf89779
commit
575935ded0
2 changed files with 6 additions and 2 deletions
|
@ -187,7 +187,11 @@ static CSYNC_EXCLUDE_TYPE _csync_excluded_common(const QString &path, bool exclu
|
|||
|
||||
// Filter out characters not allowed in a filename on windows
|
||||
for (auto p : path) {
|
||||
switch (p.unicode()) {
|
||||
const ushort c = p.unicode();
|
||||
if (c < 32) {
|
||||
return CSYNC_FILE_EXCLUDE_INVALID_CHAR;
|
||||
}
|
||||
switch (c) {
|
||||
case '\\':
|
||||
case ':':
|
||||
case '?':
|
||||
|
|
|
@ -193,10 +193,10 @@ private slots:
|
|||
|
||||
#ifdef _WIN32
|
||||
QCOMPARE(check_file_full("file_trailing_space "), CSYNC_FILE_EXCLUDE_TRAILING_SPACE);
|
||||
|
||||
QCOMPARE(check_file_full("file_trailing_dot."), CSYNC_FILE_EXCLUDE_INVALID_CHAR);
|
||||
QCOMPARE(check_file_full("AUX"), CSYNC_FILE_EXCLUDE_INVALID_CHAR);
|
||||
QCOMPARE(check_file_full("file_invalid_char<"), CSYNC_FILE_EXCLUDE_INVALID_CHAR);
|
||||
QCOMPARE(check_file_full("file_invalid_char\n"), CSYNC_FILE_EXCLUDE_INVALID_CHAR);
|
||||
#endif
|
||||
|
||||
/* ? character */
|
||||
|
|
Loading…
Reference in a new issue