From 9154a52d0a869a065cf2c7ec3183b56d5b7a5962 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Wed, 22 Mar 2023 23:58:02 -0700 Subject: [PATCH] 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 --- docs/plugins/stockpiles.rst | 3 +-- plugins/lua/stockpiles.lua | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/plugins/stockpiles.rst b/docs/plugins/stockpiles.rst index 8093b6c1d..560ae2497 100644 --- a/docs/plugins/stockpiles.rst +++ b/docs/plugins/stockpiles.rst @@ -20,8 +20,7 @@ Usage Exported stockpile settings are saved in the ``dfhack-config/stockpiles`` folder, where you can view and delete them, if desired. Names can only -contain numbers, letters, periods, underscores, dashes, and spaces. If -the name has spaces, be sure to surround it with double quotes (:kbd:`"`). +contain numbers, letters, periods, and underscores. 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 diff --git a/plugins/lua/stockpiles.lua b/plugins/lua/stockpiles.lua index f9c7d7b4a..6134f0a1b 100644 --- a/plugins/lua/stockpiles.lua +++ b/plugins/lua/stockpiles.lua @@ -62,8 +62,8 @@ local function assert_safe_name(name) if not name or #name == 0 then qerror('name missing or empty') end - if name:find('[^%a ._-]') then - qerror('name can only contain numbers, letters, periods, underscores, dashes, and spaces') + if name:find('[^%a._]') then + qerror('name can only contain numbers, letters, periods, and underscores') end end