Michael Schröder
b264fccf9e
-> OBS-URL: https://build.opensuse.org/request/show/434537 OBS-URL: https://build.opensuse.org/package/show/shells/ksh?expand=0&rev=215
21 lines
515 B
Plaintext
21 lines
515 B
Plaintext
--- src/cmd/ksh93/sh/io.c.orig 2015-12-09 11:18:00.657295950 +0000
|
|
+++ src/cmd/ksh93/sh/io.c 2015-12-09 11:18:57.719080685 +0000
|
|
@@ -1541,7 +1541,17 @@ int sh_redirect(Shell_t *shp,struct iono
|
|
sh_iosave(shp,fn,indx,tname?fname:(trunc?Empty:0));
|
|
}
|
|
else if(sh_subsavefd(fn))
|
|
+ {
|
|
+ if(fd==fn)
|
|
+ {
|
|
+ if((r=sh_fcntl(fd,F_DUPFD,10)) > 0)
|
|
+ {
|
|
+ fd = r;
|
|
+ sh_close(fn);
|
|
+ }
|
|
+ }
|
|
sh_iosave(shp,fn,indx|IOSUBSHELL,tname?fname:0);
|
|
+ }
|
|
}
|
|
if(fd<0)
|
|
{
|