(wrong string) ée

From: <git_AT_suckless.org>
Date: Mon, 16 Jan 2017 08:06:26 +0100 (CET)

commit cd63924da6e212b5672724b422eadbc71bf4e614
Author: Mattias Andrée <maandree_AT_kth.se>
AuthorDate: Mon Jan 16 08:03:21 2017 +0100
Commit: Mattias Andrée <maandree_AT_kth.se>
CommitDate: Mon Jan 16 08:03:21 2017 +0100

    blind-rotate-*: support arbitrary paths
    
    Only an idiot would use <newline> in paths, but
    let's support it anyway (for fun).

diff --git a/blind-rotate-180 b/blind-rotate-180
index 73cbd15..2f50956 100755
--- a/blind-rotate-180
+++ b/blind-rotate-180
_AT_@ -12,7 +12,7 @@ if ! test $# = 0; then
         fi
 fi
 
-flip="$(printf '%s\n' "$0" | sed 's/[^/]*$/blind-flip/')"
-flop="$(printf '%s\n' "$0" | sed 's/[^/]*$/blind-flop/')"
+flip="$(printf '%s\n' "$0" | tr '/\n' '\n/' | sed '$s/^.*$/blind-flip\//' | tr '/\n' '\n/')"
+flop="$(printf '%s\n' "$0" | tr '/\n' '\n/' | sed '$s/^.*$/blind-flop\//' | tr '/\n' '\n/')"
 
 "$flip" | "$flop"
diff --git a/blind-rotate-270 b/blind-rotate-270
index 77305ca..4c97b96 100755
--- a/blind-rotate-270
+++ b/blind-rotate-270
_AT_@ -12,7 +12,7 @@ if ! test $# = 0; then
         fi
 fi
 
-transpose="$(printf '%s\n' "$0" | sed 's/[^/]*$/blind-transpose/')"
-flop="$( printf '%s\n' "$0" | sed 's/[^/]*$/blind-flop/')"
+transpose="$(printf '%s\n' "$0" | tr '/\n' '\n/' | sed '$s/^.*$/blind-transpose\//' | tr '/\n' '\n/')"
+flop="$( printf '%s\n' "$0" | tr '/\n' '\n/' | sed '$s/^.*$/blind-flop\//' | tr '/\n' '\n/')"
 
 "$flop" | "$transpose"
diff --git a/blind-rotate-90 b/blind-rotate-90
index bbecc5b..9e41ef5 100755
--- a/blind-rotate-90
+++ b/blind-rotate-90
_AT_@ -12,7 +12,7 @@ if ! test $# = 0; then
         fi
 fi
 
-transpose="$(printf '%s\n' "$0" | sed 's/[^/]*$/blind-transpose/')"
-flop="$( printf '%s\n' "$0" | sed 's/[^/]*$/blind-flop/')"
+transpose="$(printf '%s\n' "$0" | tr '/\n' '\n/' | sed '$s/^.*$/blind-transpose\//' | tr '/\n' '\n/')"
+flop="$( printf '%s\n' "$0" | tr '/\n' '\n/' | sed '$s/^.*$/blind-flop\//' | tr '/\n' '\n/')"
 
 "$transpose" | "$flop"
Received on Mon Jan 16 2017 - 08:06:26 CET

This archive was generated by hypermail 2.3.0 : Mon Jan 16 2017 - 08:12:20 CET