diff options
Diffstat (limited to 'usr.bin/uudecode/uudecode.c')
-rw-r--r-- | usr.bin/uudecode/uudecode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/uudecode/uudecode.c b/usr.bin/uudecode/uudecode.c index 3b30be1..7bf2fcc 100644 --- a/usr.bin/uudecode/uudecode.c +++ b/usr.bin/uudecode/uudecode.c @@ -226,7 +226,7 @@ decode2(void) } q = memcpy(p - n, pw->pw_dir, n); } - } else { + } else if (strcmp(q, "/dev/stdout") != 0) { /* strip down to leaf name */ p = strrchr(q, '/'); if (p != NULL) @@ -235,7 +235,8 @@ decode2(void) if (!oflag) outfile = q; - if (pflag) + /* POSIX says "/dev/stdout" is a 'magic cookie' not a special file. */ + if (pflag || strcmp(outfile, "/dev/stdout") == 0) outfp = stdout; else { flags = O_WRONLY|O_CREAT|O_EXCL; |