From ceb98d75581b1e580725a43d14c74a138e730877 Mon Sep 17 00:00:00 2001 From: tg Date: Sat, 12 Dec 2015 18:47:40 +0000 Subject: [PATCH] we must quote a tilde in substitutions now --- dot.mkshrc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dot.mkshrc b/dot.mkshrc index 67caba6..8f241b0 100644 --- a/dot.mkshrc +++ b/dot.mkshrc @@ -1,5 +1,5 @@ # $Id$ -# $MirOS: src/bin/mksh/dot.mkshrc,v 1.102 2015/10/09 21:36:54 tg Exp $ +# $MirOS: src/bin/mksh/dot.mkshrc,v 1.103 2015/12/12 18:47:40 tg Exp $ #- # Copyright (c) 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010, # 2011, 2012, 2013, 2014, 2015 @@ -40,7 +40,7 @@ PS4='[$EPOCHREALTIME] '; PS1=$'\001\r''${| (( e )) && REPLY+="$e|" REPLY+=${USER}@${HOSTNAME%%.*}: - \typeset d=${PWD:-?} p=~; [[ $p = ?(*/) ]] || d=${d/#$p/~} + \typeset d=${PWD:-?} p=~; [[ $p = ?(*/) ]] || d=${d/#$p/\~} \typeset m=${%d} n p=...; (( m > 0 )) || m=${#d} (( m > (n = (COLUMNS/3 < 7 ? 7 : COLUMNS/3)) )) && d=${d:(-n)} || p= REPLY+=$p$d @@ -109,7 +109,7 @@ function chpwd { DIRSTACK[0]=$(\builtin realpath . 2>/dev/null || \ \builtin print -r -- "$PWD") [[ $DIRSTACKBASE = ?(*/) ]] || \ - DIRSTACK[0]=${DIRSTACK[0]/#$DIRSTACKBASE/~} + DIRSTACK[0]=${DIRSTACK[0]/#$DIRSTACKBASE/\~} \: } \chpwd . @@ -118,7 +118,7 @@ cd() { \chpwd "$@" } function cd_csh { - \typeset d t=${1/#~/$DIRSTACKBASE} + \typeset d t=${1/#\~/$DIRSTACKBASE} if ! d=$(\builtin cd "$t" 2>&1); then \builtin print -u2 "${1}: ${d##*cd: $t: }." @@ -148,7 +148,7 @@ function dirs { fv=0 while (( fv < ${#DIRSTACK[*]} )); do d=${DIRSTACK[fv]} - (( fl )) && d=${d/#~/$DIRSTACKBASE} + (( fl )) && d=${d/#\~/$DIRSTACKBASE} \builtin print -r -- "$fv $d" \builtin let fv++ done @@ -156,7 +156,7 @@ function dirs { fv=0 while (( fv < ${#DIRSTACK[*]} )); do d=${DIRSTACK[fv]} - (( fl )) && d=${d/#~/$DIRSTACKBASE} + (( fl )) && d=${d/#\~/$DIRSTACKBASE} (( dwidth = (${%d} > 0 ? ${%d} : ${#d}) )) if (( fn && (cpos += dwidth + 1) >= 79 && \ dwidth < 80 )); then