Ticket #2742: 030-bash_inputrc.patch

File 030-bash_inputrc.patch, 1.2 KB (added by kriegaex, 12 years ago)

Fix bash issue: INPUTRC was never set correctly, thus never used.

  • src/subshell.c

     
    266266        putenv (g_strdup (sid_str)); 
    267267    } 
    268268 
     269    char *putenv_str = NULL; 
    269270    switch (subshell_type) 
    270271    { 
    271272    case BASH: 
     273        /* Do we have a custom init file ~/.local/share/mc/bashrc? */ 
    272274        init_file = mc_config_get_full_path ("bashrc"); 
    273275 
     276        /* Otherwise use ~/.bashrc */ 
    274277        if (access (init_file, R_OK) == -1) 
    275278        { 
    276279            g_free (init_file); 
     
    285288            char *input_file = mc_config_get_full_path ("inputrc"); 
    286289            if (access (input_file, R_OK) == 0) 
    287290            { 
    288                 char *putenv_str = g_strconcat ("INPUTRC=", input_file, NULL); 
     291                putenv_str = g_strconcat ("INPUTRC=", input_file, NULL); 
    289292                putenv (putenv_str); 
    290                 g_free (putenv_str); 
     293                /* Do not use "g_free (putenv_str)" here, otherwise INPUTRC will be undefined! */ 
    291294            } 
    292295            g_free (input_file); 
    293296        } 
     
    350353 
    351354    /* If we get this far, everything failed miserably */ 
    352355    g_free (init_file); 
     356    g_free (putenv_str); 
    353357    _exit (FORK_FAILURE); 
    354358} 
    355359