*** bash-2.05a/shell.c.orig Thu Nov 1 23:13:16 2001 --- bash-2.05a/shell.c Tue Feb 12 17:51:11 2002 *************** *** 22,27 **** --- 22,41 ---- Sunday, January 10th, 1988. Initial author: Brian Fox */ + + /*=================================================================== + * This file was modified by SAKAIDA Masaaki. + * + * Change Logs + * 1. Add pgbashrc_file(~/.pgbashrc) and etc_pgbashrc_file(/etc/pgbashrc) + * 2. Add 'maybe_execute_file(pgbashrc_file, 1);'. + * 3. Add 'maybe_execute_file(etc_pgbashrc_file, 1);'. + * 4. If pgbashrc_file and etc_pgbashrc_file are not exist, then + * print error message. + * + *=================================================================== + */ + #define INSTALL_DEBUG_MODE #include "config.h" *************** *** 166,171 **** --- 180,187 ---- /* The name of the .(shell)rc file. */ static char *bashrc_file = "~/.bashrc"; + static char *pgbashrc_file = "~/.pgbashrc"; + static char *etc_pgbashrc_file = "/etc/pgbashrc"; /* Non-zero means to act more like the Bourne shell on startup. */ static int act_like_sh; *************** *** 932,937 **** --- 948,959 ---- # endif #endif maybe_execute_file (bashrc_file, 1); + if (maybe_execute_file (pgbashrc_file, 1)==0) + { + if (maybe_execute_file (etc_pgbashrc_file, 1)==0) + fprintf(stderr, "Error: %s or %s not found.\n\n", + pgbashrc_file, etc_pgbashrc_file ); + } return; } } *************** *** 1017,1022 **** --- 1039,1050 ---- # endif #endif maybe_execute_file (bashrc_file, 1); + if (maybe_execute_file (pgbashrc_file, 1)==0) + { + if (maybe_execute_file (etc_pgbashrc_file, 1)==0) + fprintf(stderr, "Error: %s or %s not found.\n", + pgbashrc_file, etc_pgbashrc_file ); + } } /* sh */ else if (act_like_sh && privileged_mode == 0 && sourced_env++ == 0) *************** *** 1617,1622 **** --- 1645,1652 ---- /* Ensure that the default startup file is used. (Except that we don't execute this file for reinitialized shells). */ bashrc_file = "~/.bashrc"; + pgbashrc_file = "~/.pgbashrc"; + etc_pgbashrc_file = "/etc/pgbashrc"; /* Delete all variables and functions. They will be reinitialized when the environment is parsed. */