Page MenuHomePhabricator

Terminology ignores final argument after -e
Closed, ResolvedPublic

Description

Terminology 1.1.1 ignores the final argument given when -e is used. Terminology 1.1.0 did not have this bug. The problem is an off-by-one in commit 669533fef55cede04b18a2b5f56a0c7feb242c67 - the loop bounds were incorrectly adjusted from i < argc to i < argc -1. To repro, do terminology --hold -e echo foo bar baz - only foo and bar will be printed (whereas earlier versions correctly print all 3 args).

devkev created this task.Oct 9 2017, 5:52 PM
devkev added a comment.Oct 9 2017, 6:07 PM

In the meantime I'm using this script as my ~/bin/terminology to workaround the problem.

#!/bin/bash

# Until https://phab.enlightenment.org/T6175 is fixed and released

e_found=
for i; do
	if [ "$e_found" ]; then
		e_found=yes
		break
	elif [ "$i" = "-e" ]; then
		e_found=maybe
	fi
done

if [ "$e_found" = yes ]; then
	exec /usr/bin/terminology "$@" dummy
else
	exec /usr/bin/terminology "$@"
fi