1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-09-03 20:09:37 +02:00

Lex the contents of $PAGER to support pager commands with arguments.

Closes https://github.com/openSUSE/osc/issues/264.
This commit is contained in:
Peter Simons
2017-02-11 20:21:02 +01:00
parent 9e6d1a592e
commit d86e960e30

View File

@@ -3918,8 +3918,9 @@ def run_pager(message, tmp_suffix=''):
tmpfile.write(message)
tmpfile.flush()
pager = os.getenv('PAGER', default=get_default_pager())
cmd = shlex.split(pager) + [tmpfile.name]
try:
run_external(pager, tmpfile.name)
run_external(*cmd)
finally:
tmpfile.close()