From 972efd368c62974444fa3d6b600aa41cac9db863 Mon Sep 17 00:00:00 2001 From: Nikita Ivanov Date: Tue, 26 Jul 2022 00:44:51 +0500 Subject: [PATCH] Add default values for w, h, x and y --- doc/ctpv.1 | 5 ----- src/ctpv.c | 9 +++++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/ctpv.1 b/doc/ctpv.1 index faac4e4..ba751d1 100644 --- a/doc/ctpv.1 +++ b/doc/ctpv.1 @@ -379,11 +379,6 @@ script environment: .BR $y and .BR $id . -However, they are rarely used even by built-in previews and -are only set if corresponding arguments were passed to -.B ctpv -command (see -.IR SYNOPSIS ). There are also .B $m and diff --git a/src/ctpv.c b/src/ctpv.c index de0ffb0..9da6bca 100644 --- a/src/ctpv.c +++ b/src/ctpv.c @@ -214,6 +214,15 @@ static RESULT preview(int argc, char *argv[]) GET_PARG(y, 4); GET_PARG(id, 5); + if (!w) + w = "80"; + if (!h) + h = "40"; + if (!x) + x = "0"; + if (!y) + y = "0"; + ERRCHK_RET_OK(init_previews()); struct InputFile input_f;