mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 21:05:43 +00:00
[SETUPLIB] Fix the class of characters valid for the installation directory
Commit7c3f4c94a4
(r68307) mentions the valid characters: these are: ASCII alphanumericals (a-z, A-Z, 0-9) (hence the iswalnum() -> isalnum() change), and: '.', '\\', '-', '_' . Spaces are not accepted. Addendum to commit785cc21598
.
This commit is contained in:
parent
30ac80f36b
commit
259abe59dc
3 changed files with 10 additions and 6 deletions
|
@ -731,8 +731,7 @@ IsValidInstallDirectory(
|
||||||
if (!*p || (IS_PATH_SEPARATOR(*p) && !*(p + 1)))
|
if (!*p || (IS_PATH_SEPARATOR(*p) && !*(p + 1)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* The path must contain only valid characters (alpha-numeric,
|
/* The path must contain only valid characters */
|
||||||
* '.', '\\', '-' and '_'). Spaces are not accepted. */
|
|
||||||
for (p = InstallDir; *p; ++p)
|
for (p = InstallDir; *p; ++p)
|
||||||
{
|
{
|
||||||
if (!IS_VALID_INSTALL_PATH_CHAR(*p))
|
if (!IS_VALID_INSTALL_PATH_CHAR(*p))
|
||||||
|
|
|
@ -177,8 +177,15 @@ InitSystemPartition(
|
||||||
_In_opt_ PFSVOL_CALLBACK FsVolCallback,
|
_In_opt_ PFSVOL_CALLBACK FsVolCallback,
|
||||||
_In_opt_ PVOID Context);
|
_In_opt_ PVOID Context);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
* Defines the class of characters valid for the installation directory.
|
||||||
|
*
|
||||||
|
* The valid characters are: ASCII alphanumericals (a-z, A-Z, 0-9),
|
||||||
|
* and: '.', '\\', '-', '_' . Spaces are not allowed.
|
||||||
|
**/
|
||||||
#define IS_VALID_INSTALL_PATH_CHAR(c) \
|
#define IS_VALID_INSTALL_PATH_CHAR(c) \
|
||||||
(iswalnum(c) || (c) == L'.' || (c) == L'\\' || (c) == L'-' || (c) == L'_')
|
(isalnum(c) || (c) == L'.' || (c) == L'\\' || (c) == L'-' || (c) == L'_')
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
IsValidInstallDirectory(
|
IsValidInstallDirectory(
|
||||||
|
|
|
@ -3060,9 +3060,7 @@ InstallDirectoryPage(PINPUT_RECORD Ir)
|
||||||
{
|
{
|
||||||
if (Length < 50)
|
if (Length < 50)
|
||||||
{
|
{
|
||||||
/* Only accept valid characters for installation path
|
/* Only accept valid characters for the installation path */
|
||||||
* (alpha-numeric, '.', '\', '-' and '_'). Note that
|
|
||||||
* spaces are not accepted. */
|
|
||||||
c = (WCHAR)Ir->Event.KeyEvent.uChar.AsciiChar;
|
c = (WCHAR)Ir->Event.KeyEvent.uChar.AsciiChar;
|
||||||
if (IS_VALID_INSTALL_PATH_CHAR(c))
|
if (IS_VALID_INSTALL_PATH_CHAR(c))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue