From eadc493f48eb4dc56e95cf8bcc74511c0d31b54a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Fri, 21 Sep 2018 16:17:39 +0200 Subject: [PATCH] [ion] Storage: fix regex describing compliant names --- apps/code/script.cpp | 4 ++-- ion/src/shared/storage.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/code/script.cpp b/apps/code/script.cpp index 0006b29cd..8229aea6f 100644 --- a/apps/code/script.cpp +++ b/apps/code/script.cpp @@ -26,7 +26,7 @@ const char * Script::readContent() const { } bool Script::nameCompliant(const char * name) { - /* The name format is [a-z0-9_.]* */ + /* The name format is [a-z0-9_\.]+ */ const char * currentChar = name; while (*currentChar != 0) { if ((*currentChar >= 'a' && *currentChar <= 'z') || *currentChar == '_' || (*currentChar >= '0' && *currentChar <= '9') || *currentChar == '.') { @@ -38,4 +38,4 @@ bool Script::nameCompliant(const char * name) { return name != currentChar; } -} \ No newline at end of file +} diff --git a/ion/src/shared/storage.cpp b/ion/src/shared/storage.cpp index 87a536c94..adb6d1497 100644 --- a/ion/src/shared/storage.cpp +++ b/ion/src/shared/storage.cpp @@ -279,7 +279,7 @@ bool Storage::isNameTaken(const char * name, Record * recordToExclude) { } bool Storage::nameCompliant(const char * name) { - /* The name format is .*(\.)?[a-z]+ */ + /* The name format is [^.]*\.[a-z]* */ bool dot = false; const char * currentChar = name; while (*currentChar != 0) {