Skip to content

Commit

Permalink
Add default values for w, h, x and y
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaIvanovV committed Jul 25, 2022
1 parent 9e4011e commit 972efd3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 0 additions & 5 deletions doc/ctpv.1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions src/ctpv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 972efd3

Please sign in to comment.