Index: quilt/diff.in =================================================================== RCS file: /cvsroot/quilt/quilt/quilt/diff.in,v retrieving revision 1.49 diff -u -r1.49 diff.in --- quilt/diff.in 6 Jun 2005 19:34:28 -0000 1.49 +++ quilt/diff.in 27 Jun 2005 07:27:01 -0000 @@ -335,16 +335,10 @@ patch_file=$(patch_file_name $last_patch) patch_args=$(patch_args $last_patch) workdir=$(gen_tempfile -d $PWD/quilt) - pwd=$PWD - if ! cd $QUILT_PC/$last_patch - then - printf $"Cannot change into directory %s\n" \ - "$QUILT_PC/$last_patch" >&2 - die 1 - fi if [ address@hidden -gt 0 ] \ - && ! cp -l --parents "address@hidden" $workdir/ + && ! ( cd $QUILT_PC/$last_patch && + cp -l --parents "address@hidden" $workdir/ ) then printf $"Failed to copy files to temporary directory\n" >&2 die 1 @@ -355,16 +349,10 @@ # them: We must remove them here. find $workdir -type f -size 0 -exec rm -f '{}' ';' - if ! cd $workdir + if [ -s $patch_file ] then - printf $"Cannot change to temporary directory\n" >&2 - die 1 - fi - - if [ -s $pwd/$patch_file ] - then - if ! cat_file $pwd/$patch_file \ - | @PATCH@ $QUILT_PATCH_OPTS $patch_args \ + if ! cat_file $patch_file \ + | @PATCH@ -d $workdir $QUILT_PATCH_OPTS $patch_args \ --no-backup-if-mismatch -Ef \ >/dev/null 2>/dev/null then @@ -373,18 +361,13 @@ # applied, we know that it won't apply cleanly. In # all other cases, print a warning. - if [ ! -e $pwd/$QUILT_PC/$last_patch~refresh -a \ + if [ ! -e $QUILT_PC/$last_patch~refresh -a \ address@hidden -eq 0 ] then printf $"Failed to patch temporary files\n" >&2 fi fi fi - if ! cd $pwd - then - printf $"Cannot change to source directory\n" >&2 - die 1 - fi fi for file in "address@hidden"