From: Lady Date: Mon, 22 Jan 2024 01:36:38 +0000 (-0500) Subject: Disallow backslash in filenames; filter out spaces X-Git-Tag: 0.4.3~1 X-Git-Url: https://git.ladys.computer/Shushe/commitdiff_plain/c6779bb65edc0232b3dbac696a001a89770c5e65?ds=inline Disallow backslash in filenames; filter out spaces Space characters will break this make·file, so like other characters which might break it should be filtered out by `find`. Backslashes feel very fraught, especially under secondary expansion, and should be dis·allowed for simplicity. --- diff --git a/GNUmakefile b/GNUmakefile index 79049c8..bcaa00d 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -145,7 +145,7 @@ MAGICDIR := $(patsubst ./%,%,$(THISDIR)/magic) # Configuration of `find´. # # By default, `find´ will ignore files which begin with a period and those which are likely to cause problems for `make´. -FINDRULES := ! '(' '(' -name '[.-]*' -o -name '*[][*?:|$$%\#;]*' ')' -a -prune ')' +FINDRULES := ! '(' '(' -name '[.-]*' -o -name '*[][*?:|$$%\#\\; ]*' ')' -a -prune ')' FINDINCLUDERULES := $(FINDRULES) # The list of parsers for plaintext file types. diff --git a/README.markdown b/README.markdown index 3801b7e..0941b52 100644 --- a/README.markdown +++ b/README.markdown @@ -162,7 +162,7 @@ The following additional variables can be used to control the behaviour Rules to use with `find` when searching for source files. The default ignores files that start with a period or hyphen‐minus and those which contain a hash, buck, percent, asterisk, colon, - semi, eroteme, bracket, or pipe. + semi, eroteme, bracket, backslash, or pipe. - **`FINDINCLUDERULES`:** Rules to use with `find` when searching for includes (default: @@ -211,8 +211,8 @@ Source files whose media type does not have an associated X·S·L·T **☡ For compatibility with this program, source file·names must not contain Ascii white·space, colons (`:`), semis (`;`), pipes (`|`), bucks (`$`), percents (`%`), hashes (`#`), asterisks (`*`), brackets - (`[` or `]`), erotemes (`?`), or control characters, and must not - begin with a hyphen‐minus (`-`).** + (`[` or `]`), erotemes (`?`), backslashes (`\`), or control + characters, and must not begin with a hyphen‐minus (`-`).** The former characters have the potential to conflict with make syntax, and a leading hyphen‐minus is confusable for a command‐line argument.