From: Masatake YAMATO Date: Wed, 20 Oct 2021 13:29:45 +0000 (+0900) Subject: lsfd: remove --source option X-Git-Tag: v2.38-rc1~144^2~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ddd511624a130184f6d3fbcf7a79dfc1db329051;p=thirdparty%2Futil-linux.git lsfd: remove --source option -Q '(SOURCE == ...)' works well for the same purpose. See https://github.com/karelzak/util-linux/pull/1418#issuecomment-945643880 Signed-off-by: Masatake YAMATO --- diff --git a/misc-utils/lsfd.c b/misc-utils/lsfd.c index 247c678ee0..3d27466e78 100644 --- a/misc-utils/lsfd.c +++ b/misc-utils/lsfd.c @@ -991,7 +991,6 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" --sysroot use specified directory as system root\n"), out); fputs(_(" -u, --notruncate don't truncate text in columns\n"), out); fputs(_(" -Q, --filter apply display filter\n"), out); - fputs(_(" --source add filter by SOURCE\n"), out); fputs(_(" --debug-filter dump the innternal data structure of filter and exit\n"), out); fputs(USAGE_SEPARATOR, out); @@ -1023,28 +1022,6 @@ static void xstrputc(char **a, char c) xstrappend(a, b); } -static char * quote_filter_expr(char *expr) -{ - char c[] = {'\0', '\0'}; - char *r = strdup(""); - while (*expr) { - switch (*expr) { - case '\'': - xstrappend(&r, "\\'"); - break; - case '"': - xstrappend(&r, "\\\""); - break; - default: - c[0] = *expr; - xstrappend(&r, c); - break; - } - expr++; - } - return r; -} - static void append_filter_expr(char **a, const char *b, bool and) { if (*a == NULL) { @@ -1077,7 +1054,6 @@ int main(int argc, char *argv[]) enum { OPT_SYSROOT = CHAR_MAX + 1, - OPT_SOURCE, OPT_DEBUG_FILTER, }; static const struct option longopts[] = { @@ -1091,7 +1067,6 @@ int main(int argc, char *argv[]) { "notruncate", no_argument, NULL, 'u' }, { "sysroot", required_argument, NULL, OPT_SYSROOT }, { "filter", required_argument, NULL, 'Q' }, - { "source", required_argument, NULL, OPT_SOURCE }, { "debug-filter",no_argument, NULL, OPT_DEBUG_FILTER }, { NULL, 0, NULL, 0 }, }; @@ -1127,17 +1102,6 @@ int main(int argc, char *argv[]) case 'Q': append_filter_expr(&filter_expr, optarg, true); break; - case OPT_SOURCE: { - char * quoted_source = quote_filter_expr(optarg); - char * source_expr = NULL; - xstrappend(&source_expr, "(SOURCE == '"); - xstrappend(&source_expr, quoted_source); - xstrappend(&source_expr, "')"); - append_filter_expr(&filter_expr, source_expr, true); - free(source_expr); - free(quoted_source); - break; - } case OPT_DEBUG_FILTER: debug_filter = true; break;