aboutsummaryrefslogtreecommitdiff
path: root/bb.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-10-09 15:01:50 -0700
committerBruce Hill <bruce@bruce-hill.com>2019-10-09 15:01:50 -0700
commit9a1599e728b3ff7cc32ece9a691876c9e0dde4e8 (patch)
tree458295752759080c470a1c184d0311bb30f7049d /bb.h
parent220d0dc4025e845b2060c2f508c70b90481a3796 (diff)
Moved bbstartup search to a loop.
Diffstat (limited to 'bb.h')
-rw-r--r--bb.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/bb.h b/bb.h
index 6b8efb0..01be685 100644
--- a/bb.h
+++ b/bb.h
@@ -305,12 +305,11 @@ SPIN ";\n"
const char *runstartup =
"[ ! \"$XDG_CONFIG_HOME\" ] && XDG_CONFIG_HOME=~/.config;\n"
"[ ! \"$sysconfdir\" ] && sysconfdir=/etc;\n"
-"if [ -e \"$XDG_CONFIG_HOME/bb/bbstartup.sh\" ]; then\n"
-" . \"$XDG_CONFIG_HOME/bb/bbstartup.sh\";\n"
-"elif [ -e \"$sysconfdir/xdg/bb/bbstartup.sh\" ]; then\n"
-" . \"$sysconfdir/xdg/bb/bbstartup.sh\";\n"
-"elif [ -e \"./bbstartup.sh\" ]; then\n"
-" . \"./bbstartup.sh\";\n"
-"fi\n";
+"for path in \"$XDG_CONFIG_HOME/bb\" \"$sysconfdir/xdg/bb\" .; do\n"
+" if [ -e \"$path/bbstartup.sh\" ]; then\n"
+" . \"$path/bbstartup.sh\";\n"
+" break;\n"
+" fi;\n"
+"done\n";
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1