kisslinux / kiss

KISS Linux - Package Manager
https://kisslinux.github.io
MIT License
464 stars 62 forks source link

kiss-size: fix for packages containing files with quotes in filenames #292

Closed aabacchus closed 6 months ago

aabacchus commented 2 years ago

if a package contains a file with a single quote in it's name, xargs complains about an unmatched quote and fails, and the pipeline is aborted. this patch wraps each filename in quotes so that xargs can handle such filenames.

rewrite of #291 to be POSIX-compliant

E5ten commented 2 years ago

Wouldn't this still result in incorrect behaviour if the file has a double quote in its name? Although I think behaviour in that situation wouldn't be any better without this change, so it's probably still better than nothing as is.

EDIT: maybe a better solution would be using the sed call to escape all characters that xargs treats specially with \, including non-newline whitespace and both types of quotes?

aabacchus commented 2 years ago

You're right. I've changed this following an example from the POSIX specification for xargs: prefixing every non-alphanumeric character with a backslash to escape them.