summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorPim Snel <pim@lingewoud.nl>2020-02-10 17:46:19 +0100
committerPim Snel <pim@lingewoud.nl>2020-02-10 17:46:19 +0100
commitb48a8c0e2390798b57772884a5b3ff10d964baa5 (patch)
treeb9d4b1cd797b5cdbc97d297505d9f6d76b487293 /src/main.c
parent862c27396e1ce43624c5499d759b81557295ea76 (diff)
read stdin after file loading
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 99fbc84..3497a13 100644
--- a/src/main.c
+++ b/src/main.c
@@ -282,13 +282,13 @@ int main (int argc, char ** argv) {
// 2. loadrc
loadrc();
- // 3. check input from stdin (pipeline)
+ // 3. read sc file passed as argv
+ load_sc();
+
+ // 4. check input from stdin (pipeline)
// and send it to interp
read_stdin();
- // 4. read sc file passed as argv
- load_sc();
-
// change curmode to NORMAL_MODE
chg_mode('.');
@@ -576,6 +576,7 @@ void read_argv(int argc, char ** argv) {
void load_sc() {
char name[PATHLEN];
+ strcpy(name, ""); //force name to be empty
#ifdef NO_WORDEXP
size_t len;
#else