X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Futil.h;h=d9d525e8a51215eedcb815d5f6c8de924602faae;hb=6073b6f26ab9fc6bf335faa7073ec443eef093fd;hp=c5eadc97c093c091264201c7ef330efb1549849e;hpb=e26807239bd65bc17535a53cd540f38600e7ef24;p=elogind.git diff --git a/src/shared/util.h b/src/shared/util.h index c5eadc97c..d9d525e8a 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -93,6 +93,12 @@ #define COMMENTS "#;" #define GLOB_CHARS "*?[" +/* What characters are special in the shell? */ +/* must be escaped outside and inside double-quotes */ +#define SHELL_NEED_ESCAPE "\"\\`$" +/* can be escaped or double-quoted */ +#define SHELL_NEED_QUOTES SHELL_NEED_ESCAPE GLOB_CHARS "'()<>|&;" + #define FORMAT_BYTES_MAX 8 #define ANSI_HIGHLIGHT_ON "\x1B[1;39m" @@ -493,6 +499,7 @@ noreturn void freeze(void); bool null_or_empty(struct stat *st) _pure_; int null_or_empty_path(const char *fn); +int null_or_empty_fd(int fd); DIR *xopendirat(int dirfd, const char *name, int flags);