summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorjnweiger <jnweiger>2005-12-16 19:00:17 +0000
committerjnweiger <jnweiger>2005-12-16 19:00:17 +0000
commita32c84cd45ba849ec0dc69546d2fc3aa59dfc613 (patch)
tree0da6276a94914b632e4ef4c8a3327dabc95ac0ff /src/fileio.c
parent75b909204c353b772a978afcc7d170aca5636296 (diff)
downloadscreen-a32c84cd45ba849ec0dc69546d2fc3aa59dfc613.tar.gz
11.10.2004, 4.00.03jw handle StartRc errors nonfatal if due to a msg.
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/fileio.c b/src/fileio.c
index ab5e9c7..631c37e 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -128,9 +128,9 @@ char *rcfile;
* 1) rcfilename = "/etc/screenrc"
* 2) rcfilename = RcFileName
*/
-void
-StartRc(rcfilename)
-char *rcfilename;
+int
+StartRc(rcfilename, nopanic)
+char *rcfilename, int nopanic;
{
register int argc, len;
register char *p, *cp;
@@ -159,13 +159,13 @@ char *rcfilename;
* the file.
*/
debug3("StartRc: '%s','%s', '%s'\n", RcFileName, rc_name, rcfilename);
- Panic(0, "Unable to open \"%s\".", rc_name);
- /* NOTREACHED */
+ if (!nopanic) Panic(0, "Unable to open \"%s\".", rc_name);
+ /* possibly NOTREACHED */
}
debug1("StartRc: '%s' no good. ignored\n", rc_name);
Free(rc_name);
rc_name = oldrc_name;
- return;
+ return 1;
}
while (fgets(buf, sizeof buf, fp) != NULL)
{
@@ -238,7 +238,7 @@ char *rcfilename;
if (rc_recursion <= 10)
{
rc_recursion++;
- StartRc(args[1]);
+ (void)StartRc(args[1], 0);
rc_recursion--;
}
}
@@ -246,6 +246,7 @@ char *rcfilename;
fclose(fp);
Free(rc_name);
rc_name = oldrc_name;
+ return 0;
}
void