Good morning.
Attached was has been pushed to [master].
(._.);

--steffen
Author: Steffen (Daode) Nurpmeso <[email protected]>
Date:   2015-05-05 10:35:57 +0200

    Fix temporary variable assignments (Ypnose)..
    
    Ypnose reported [1] that with v14.8.0 his $PAGER is no longer
    imported from the environment.  That is because we now explicitly
    set some variables which are silently used with default settings
    if not set explicitly, so that users will see those default values
    in the output of `set': e.g., in an ArchLinux Forum thread [2]
    a user simply didn't know where the path "/usr/bin/sendmail" came
    from, not knowing it is intransparent fallback for *sendmail*.
    
    Of course (at least) any variable that POSIX defines to be an
    environment variable must be inherited from the environment.
    Until we have an all-automatic table-driven approach for this, fix
    [a61c07e] (main.c: until automatic, set some more variables..,
    2015-04-24) and explicitly import SHELL/LISTER/PAGER if possible,
    set the fallbacks only otherwise.
    
      [1] http://article.gmane.org/gmane.mail.s-nail.user/252
      [2] https://bbs.archlinux.org/viewtopic.php?id=194254
---
 main.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/main.c b/main.c
index 26270f4..03c4eee 100644
--- a/main.c
+++ b/main.c
@@ -316,13 +316,21 @@ _startup(void)
    /* TODO until we have an automatic mechanism for that, set some more
     * TODO variables so that users see the internal fallback settings
     * TODO (something like "defval=X,notempty=1") */
-   {
-   ok_vset(SHELL, XSHELL);
-   ok_vset(LISTER, XLISTER);
-   ok_vset(PAGER, XPAGER);
-   ok_vset(sendmail, SENDMAIL);
-   ok_vset(sendmail_progname, SENDMAIL_PROGNAME);
-   }
+   do {
+      char const *vp;
+
+      vp = env_vlook("SHELL", TRU1);
+      ok_vset(SHELL, (vp != NULL ? vp : XSHELL));
+
+      vp = env_vlook("LISTER", TRU1);
+      ok_vset(LISTER, (vp != NULL ? vp : XLISTER));
+
+      vp = env_vlook("PAGER", TRU1);
+      ok_vset(PAGER, (vp != NULL ? vp : XPAGER));
+
+      ok_vset(sendmail, SENDMAIL);
+      ok_vset(sendmail_progname, SENDMAIL_PROGNAME);
+   } while (0);
 
    /*  --  >8  --  8<  --  */
 
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
S-nail-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/s-nail-users

Reply via email to