minimal/do: fix failure with paths containing spaces.
We grew a test for these at some point, but minimal/do didn't actually
pass it.
sh syntax oddity: if you say
x=$1 y=$2
then it works fine when $1 and $2 contain spaces. But if you say
export x=$1 y=$2
(or "local" instead of "export") then $1 and $2 will be split on IFS,
and it won't do what you think. I guess this is because 'export' and
'local' are like commands, and command arguments are split if not
quoted.
This commit is contained in:
parent
0d174f92c3
commit
a3077a4a4d
1 changed files with 2 additions and 2 deletions
|
|
@ -91,7 +91,7 @@ _find_dofile()
|
||||||
_run_dofile()
|
_run_dofile()
|
||||||
{
|
{
|
||||||
export DO_DEPTH="$DO_DEPTH "
|
export DO_DEPTH="$DO_DEPTH "
|
||||||
export REDO_TARGET=$PWD/$target
|
export REDO_TARGET="$PWD/$target"
|
||||||
local line1
|
local line1
|
||||||
set -e
|
set -e
|
||||||
read line1 <"$PWD/$dofile" || true
|
read line1 <"$PWD/$dofile" || true
|
||||||
|
|
@ -106,7 +106,7 @@ _run_dofile()
|
||||||
|
|
||||||
_do()
|
_do()
|
||||||
{
|
{
|
||||||
local dir=$1 target=$2 tmp=$3
|
local dir="$1" target="$2" tmp="$3"
|
||||||
if [ ! -e "$target" ] || [ -d "$target" -a ! -e "$target.did" ]; then
|
if [ ! -e "$target" ] || [ -d "$target" -a ! -e "$target.did" ]; then
|
||||||
printf '%sdo %s%s%s%s\n' \
|
printf '%sdo %s%s%s%s\n' \
|
||||||
"$green" "$DO_DEPTH" "$bold" "$dir$target" "$plain" >&2
|
"$green" "$DO_DEPTH" "$bold" "$dir$target" "$plain" >&2
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue