From e2f959337ef84f2feb1e2f4e4f48674e174e8f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 15 Jun 2021 08:07:05 +0200 Subject: (ROX) SendTo/diff: Re-arrange x, x.orig to x.orig, x --- .../.config/rox.sourceforge.net/SendTo/.group/diff | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'home') diff --git a/home/john/.config/rox.sourceforge.net/SendTo/.group/diff b/home/john/.config/rox.sourceforge.net/SendTo/.group/diff index b780c24..d29602e 100755 --- a/home/john/.config/rox.sourceforge.net/SendTo/.group/diff +++ b/home/john/.config/rox.sourceforge.net/SendTo/.group/diff @@ -1,5 +1,29 @@ #!/bin/sh + d="$(dirname "$1")/" cd "$d" + +# Re-arrange x, x.orig to x.orig, x +i=0 +while [ $((++i)) -le $# ]; do + if [ $i -le $# ]; then + if [ x"$1" = x"${2%.orig}" ]; then + a=$1 + b=$2 + shift 2 + : $((++i)) + set -- "$@" "$b" "$a" + else + a=$1 + shift + set -- "$@" "$a" + fi + else + a=$1 + shift + set -- "$@" "$a" + fi +done + t=diff; for x in "$@"; do t=$t" ${x#$d}"; done -exec xterm -title "$t" -e with-shell diff -u "$@" +exec xterm -title "$t" -e with-pager diff -u "$@" -- cgit v1.2.3