pm

barely a pack manager
git clone git://z3bra.org/pm
Log | Files | Refs | README | LICENSE

commit 3afe77e21dd955174efc8647a7c04a19370e64ba
parent 05c187f408ad9b7aeec9434070073f13ff78a0f4
Author: Adrian Grigore <adrian.emil.grigore@gmail.com>
Date:   Thu, 11 Apr 2019 11:42:27 +0200

Use ERE instead of BRE for POSIX compliance

Diffstat:
config.h | 2+-
pm.c | 4++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/config.h b/config.h @@ -2,4 +2,4 @@ #define PACK_ROOT (getenv("ROOT")?getenv("ROOT"):"") #define PACK_DATA (getenv("DATA")?getenv("DATA"):"/var/db/pm") #define PACK_BUFF_SIZE 8192 -#define PACK_FORMAT "\\([-_a-z0-9]*\\)@\\([.a-zA-Z0-9]*\\)\\.t\\(bz\\|gz\\|xz\\)" +#define PACK_FORMAT "([-_a-z0-9]*)@([.a-zA-Z0-9]*).t(bz|gz|xz)" diff --git a/pm.c b/pm.c @@ -168,7 +168,7 @@ re_match(const char *re, const char *str) regex_t preg; regmatch_t sub[1]; - if (regcomp(&preg, re, 0)) { + if (regcomp(&preg, re, REG_EXTENDED)) { fprintf(stderr, "%s: Not a valid expression\n", re); return -1; } @@ -199,7 +199,7 @@ pack_load_tarball(char *path) return NULL; } - regcomp(&preg, regex, 0); + regcomp(&preg, regex, REG_EXTENDED); regexec(&preg, fn, nmatch, sub, 0); if (!(pack = malloc(sizeof(struct pack)))) {