From ea4b98e6577ad4311e4eb4d2384c82f0d870b5ba Mon Sep 17 00:00:00 2001 From: Alexander Kuleshov Date: Sat, 20 Feb 2016 00:25:13 +0600 Subject: tree-wide: merge pager_open_if_enabled() to the pager_open() Many subsystems define own pager_open_if_enabled() function which checks '--no-pager' command line argument and open pager depends on its value. All implementations of pager_open_if_enabled() are the same. Let's merger this function with pager_open() from the shared/pager.c and remove pager_open_if_enabled() from all subsytems to prevent code duplication. --- src/delta/delta.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/delta') diff --git a/src/delta/delta.c b/src/delta/delta.c index a54fc89de6..b055075e55 100644 --- a/src/delta/delta.c +++ b/src/delta/delta.c @@ -85,14 +85,6 @@ static enum { (SHOW_MASKED | SHOW_EQUIVALENT | SHOW_REDIRECTED | SHOW_OVERRIDDEN | SHOW_EXTENDED) } arg_flags = 0; -static void pager_open_if_enabled(void) { - - if (arg_no_pager) - return; - - pager_open(false); -} - static int equivalent(const char *a, const char *b) { _cleanup_free_ char *x = NULL, *y = NULL; @@ -610,7 +602,7 @@ int main(int argc, char *argv[]) { else if (arg_diff) arg_flags |= SHOW_OVERRIDDEN; - pager_open_if_enabled(); + pager_open(arg_no_pager, false); if (optind < argc) { int i; -- cgit v1.2.3-54-g00ecf