thandle /dev/stdin always - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 134c20c60516eb6b6a4f1148a5a24767d38de3a4
 (DIR) parent 0faf0f0baa92349a203a419f8e1db76104e42313
 (HTM) Author: rsc <devnull@localhost>
       Date:   Sun, 13 Feb 2005 21:38:32 +0000
       
       handle /dev/stdin always
       
       Diffstat:
         M src/cmd/rc/plan9ish.c               |       4 ++--
         M src/cmd/rc/simple.c                 |       2 +-
       
       2 files changed, 3 insertions(+), 3 deletions(-)
       ---
 (DIR) diff --git a/src/cmd/rc/plan9ish.c b/src/cmd/rc/plan9ish.c
       t@@ -459,8 +459,8 @@ int Creat(char *file)
        int Dup(int a, int b){
                return dup(a, b);
        }
       -int Dup1(int unused0){
       -        return -1;
       +int Dup1(int a){
       +        return dup(a, -1);
        }
        void Exit(char *stat)
        {
 (DIR) diff --git a/src/cmd/rc/simple.c b/src/cmd/rc/simple.c
       t@@ -316,11 +316,11 @@ void execdot(void){
                        strcpy(file, path->word);
                        if(file[0]) strcat(file, "/");
                        strcat(file, zero);
       -                if((fd=open(file, 0))>=0) break;
                        if(strcmp(file, "/dev/stdin")==0){        /* for sun & ucb */
                                fd=Dup1(0);
                                if(fd>=0) break;
                        }
       +                if((fd=open(file, 0))>=0) break;
                }
                if(fd<0){
                        pfmt(err, "%s: ", zero);