aboutsummaryrefslogtreecommitdiffstats
path: root/rcfile_y.y
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-11-05 06:48:22 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-11-05 06:48:22 +0000
commit20d8df46af60ac0b93600da8018bf712b0a761ad (patch)
tree77992f80d616a740c119531dd3b4f601ac4da1ea /rcfile_y.y
parenta39c16655a2d05c7981211352e33d7159758c4f7 (diff)
downloadfetchmail-20d8df46af60ac0b93600da8018bf712b0a761ad.tar.gz
fetchmail-20d8df46af60ac0b93600da8018bf712b0a761ad.tar.bz2
fetchmail-20d8df46af60ac0b93600da8018bf712b0a761ad.zip
Enable - as config file argument.
svn path=/trunk/; revision=2175
Diffstat (limited to 'rcfile_y.y')
-rw-r--r--rcfile_y.y12
1 files changed, 9 insertions, 3 deletions
diff --git a/rcfile_y.y b/rcfile_y.y
index 12851030..3170ccca 100644
--- a/rcfile_y.y
+++ b/rcfile_y.y
@@ -357,10 +357,14 @@ int prc_filecheck(const char *pathname, const flag securecheck)
errno = 0;
- /* special cases useful for debugging purposes */
+ /* special case useful for debugging purposes */
if (strcmp("/dev/null", pathname) == 0)
return(PS_SUCCESS);
+ /* pass through the special name for stdin */
+ if (strcmp("-", pathname) == 0)
+ return(PS_SUCCESS);
+
/* the run control file must have the same uid as the REAL uid of this
process, it must have permissions no greater than 600, and it must not
be a symbolic link. We check these conditions here. */
@@ -413,8 +417,10 @@ int prc_parse_file (const char *pathname, const flag securecheck)
if (errno == ENOENT)
return(PS_SUCCESS);
- /* Open the configuration and feed it to the lexer. */
- if ((yyin = fopen(pathname,"r")) == (FILE *)NULL) {
+ /* Open the configuration file and feed it to the lexer. */
+ if (strcmp(pathname, "-") == 0)
+ yyin = stdin;
+ else if ((yyin = fopen(pathname,"r")) == (FILE *)NULL) {
error(0, errno, "open: %s", pathname);
return(PS_IOERR);
}