]> git.sur5r.net Git - i3/i3/commitdiff
nagbar: use less / vi as fallbacks for PAGER / EDITOR
authorMichael Stapelberg <michael@stapelberg.de>
Mon, 11 Jul 2011 14:40:10 +0000 (16:40 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Mon, 11 Jul 2011 14:40:10 +0000 (16:40 +0200)
src/cfgparse.y

index 227471089571270a1de619490ad2d63e3dd9d277..64be79084a28fba7b0450ebdcc66f74c1f437e51 100644 (file)
@@ -258,9 +258,9 @@ static void start_configerror_nagbar(const char *config_path) {
     if (configerror_pid == 0) {
         char *editaction,
              *pageraction;
-        if (asprintf(&editaction, TERM_EMU " -e $EDITOR \"%s\"", config_path) == -1)
+        if (asprintf(&editaction, TERM_EMU " -e ${EDITOR:-vi} \"%s\"", config_path) == -1)
             exit(1);
-        if (asprintf(&pageraction, TERM_EMU " -e $PAGER \"%s\"", errorfilename) == -1)
+        if (asprintf(&pageraction, TERM_EMU " -e ${PAGER:-less} \"%s\"", errorfilename) == -1)
             exit(1);
         char *argv[] = {
             NULL, /* will be replaced by the executable path */