remove spaces and dashes from allowed filename chars

since this will likely make it more difficult to represent stockpile
filenames in quickfort's stockpile configuration language
develop
Myk Taylor 2023-03-22 23:58:02 -07:00
parent 22872f61c4
commit 9154a52d0a
No known key found for this signature in database
2 changed files with 3 additions and 4 deletions

@ -20,8 +20,7 @@ Usage
Exported stockpile settings are saved in the ``dfhack-config/stockpiles`` Exported stockpile settings are saved in the ``dfhack-config/stockpiles``
folder, where you can view and delete them, if desired. Names can only folder, where you can view and delete them, if desired. Names can only
contain numbers, letters, periods, underscores, dashes, and spaces. If contain numbers, letters, periods, and underscores.
the name has spaces, be sure to surround it with double quotes (:kbd:`"`).
The names of library settings files are all prefixed by the string ``library/``. The names of library settings files are all prefixed by the string ``library/``.
You can specify library files explicitly by including the prefix, or you can You can specify library files explicitly by including the prefix, or you can

@ -62,8 +62,8 @@ local function assert_safe_name(name)
if not name or #name == 0 then if not name or #name == 0 then
qerror('name missing or empty') qerror('name missing or empty')
end end
if name:find('[^%a ._-]') then if name:find('[^%a._]') then
qerror('name can only contain numbers, letters, periods, underscores, dashes, and spaces') qerror('name can only contain numbers, letters, periods, and underscores')
end end
end end