aboutsummaryrefslogtreecommitdiff
path: root/vis-lua.c
diff options
context:
space:
mode:
authorChristian Hesse <mail@eworm.de>2017-02-02 09:22:42 +0100
committerChristian Hesse <mail@eworm.de>2017-02-02 12:35:08 +0100
commit36b03e5d0ccee3228b19084ccb4a5e67ee06ef73 (patch)
tree1a915d689c3c6732783c3dbfc03df63eac52ab93 /vis-lua.c
parenta8f67d43b698eab119bb611cba840e67591a4e5c (diff)
downloadvis-36b03e5d0ccee3228b19084ccb4a5e67ee06ef73.tar.gz
vis-36b03e5d0ccee3228b19084ccb4a5e67ee06ef73.tar.xz
add /etc/vis to lua path for system-wide configuration by administrator
Diffstat (limited to 'vis-lua.c')
-rw-r--r--vis-lua.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/vis-lua.c b/vis-lua.c
index 4bec955..e45f694 100644
--- a/vis-lua.c
+++ b/vis-lua.c
@@ -2186,6 +2186,7 @@ void vis_lua_init(Vis *vis) {
* - $VIS_PATH/{,lexers}
* - {,lexers} relative to the binary location
* - $XDG_CONFIG_HOME/vis/{,lexers} (defaulting to $HOME/.config/vis/{,lexers})
+ * - /etc/vis/{,lexers} (for system-wide configuration provided by administrator)
* - /usr/local/share/vis/{,lexers} (or whatever is specified during ./configure)
* - package.path (standard lua search path)
*/
@@ -2201,6 +2202,8 @@ void vis_lua_init(Vis *vis) {
home = pw->pw_dir;
}
+ vis_lua_path_add(vis, "/etc/vis");
+
const char *xdg_config = getenv("XDG_CONFIG_HOME");
if (xdg_config) {
snprintf(path, sizeof path, "%s/vis", xdg_config);