Add BITCHXRC_NAME to config.h
(instead of hardcoding it in irc.c). Simplify setting of ircrc_file and bircrc_file. Use IRCRC_NAME and BITCHXRC_NAME in help strings.
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
[Changes 1.2.2]
|
[Changes 1.2.2]
|
||||||
|
|
||||||
|
* Add BITCHXRC_NAME to config.h. (caf)
|
||||||
|
|
||||||
* Correctly handle case when a nick comes between a -s flag and a server name
|
* Correctly handle case when a nick comes between a -s flag and a server name
|
||||||
on the command line (reported by gauze). (caf)
|
on the command line (reported by gauze). (caf)
|
||||||
|
|
||||||
|
|||||||
@@ -322,9 +322,11 @@
|
|||||||
* Define the name of your ircrc file here.
|
* Define the name of your ircrc file here.
|
||||||
*/
|
*/
|
||||||
#if defined(WINNT) || defined(__EMX__)
|
#if defined(WINNT) || defined(__EMX__)
|
||||||
#define IRCRC_NAME "/irc-rc"
|
#define IRCRC_NAME "irc-rc"
|
||||||
|
#define BITCHXRC_NAME "bx-rc"
|
||||||
#else
|
#else
|
||||||
#define IRCRC_NAME "/.ircrc"
|
#define IRCRC_NAME ".ircrc"
|
||||||
|
#define BITCHXRC_NAME ".bitchxrc"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DEFAULT_PING_TYPE 1
|
#define DEFAULT_PING_TYPE 1
|
||||||
|
|||||||
37
source/irc.c
37
source/irc.c
@@ -154,7 +154,7 @@ int inbound_line_mangler = 0,
|
|||||||
|
|
||||||
char *invite_channel = NULL, /* last channel of an INVITE */
|
char *invite_channel = NULL, /* last channel of an INVITE */
|
||||||
*ircrc_file = NULL, /* full path .ircrc file */
|
*ircrc_file = NULL, /* full path .ircrc file */
|
||||||
*bircrc_file = NULL, /* full path .ircrc file */
|
*bircrc_file = NULL, /* full path .bitchxrc file */
|
||||||
*my_path = NULL, /* path to users home dir */
|
*my_path = NULL, /* path to users home dir */
|
||||||
*irc_path = NULL, /* paths used by /load */
|
*irc_path = NULL, /* paths used by /load */
|
||||||
*irc_lib = NULL, /* path to the ircII library */
|
*irc_lib = NULL, /* path to the ircII library */
|
||||||
@@ -220,22 +220,14 @@ static char *switch_help[] = {
|
|||||||
" -N do not auto-connect to the first server\n",
|
" -N do not auto-connect to the first server\n",
|
||||||
" -A do not display the startup ansi\n",
|
" -A do not display the startup ansi\n",
|
||||||
" -c <channel>\tjoins <channel> on startup. don\'t forget to escape the # using \\\n",
|
" -c <channel>\tjoins <channel> on startup. don\'t forget to escape the # using \\\n",
|
||||||
#if defined(WINNT) || defined(__EMX__)
|
" -b\t\tload " BITCHXRC_NAME " or " IRCRC_NAME " after connecting to a server\n",
|
||||||
" -b\t\tload bx-rc or irc-rc after connecting to a server\n",
|
|
||||||
#else
|
|
||||||
" -b\t\tload .bitchxrc or .ircrc after connecting to a server\n",
|
|
||||||
#endif
|
|
||||||
" -p <port>\tdefault server connection port (usually 6667)\n",
|
" -p <port>\tdefault server connection port (usually 6667)\n",
|
||||||
#ifndef WINNT
|
#ifndef WINNT
|
||||||
" -f\t\tyour terminal uses flow controls (^S/^Q), so BitchX shouldn't\n",
|
" -f\t\tyour terminal uses flow controls (^S/^Q), so BitchX shouldn't\n",
|
||||||
" -F\t\tyour terminal doesn't use flow control (default)\n",
|
" -F\t\tyour terminal doesn't use flow control (default)\n",
|
||||||
#endif
|
#endif
|
||||||
" -d\t\truns BitchX in \"dumb\" terminal mode\n",
|
" -d\t\truns BitchX in \"dumb\" terminal mode\n",
|
||||||
#if defined(WINNT) || defined(__EMX__)
|
" -q\t\tdoes not load ~/" IRCRC_NAME "\n",
|
||||||
" -q\t\tdoes not load ~/irc-rc\n",
|
|
||||||
#else
|
|
||||||
" -q\t\tdoes not load ~/.ircrc\n",
|
|
||||||
#endif
|
|
||||||
" -r file\tload file as list of servers\n",
|
" -r file\tload file as list of servers\n",
|
||||||
" -n nickname\tnickname to use\n",
|
" -n nickname\tnickname to use\n",
|
||||||
" -a\t\tadds default servers and command line servers to server list\n",
|
" -a\t\tadds default servers and command line servers to server list\n",
|
||||||
@@ -247,13 +239,8 @@ static char *switch_help[] = {
|
|||||||
" -s\t\tnext server specified is SSL (may be used multiple times)\n",
|
" -s\t\tnext server specified is SSL (may be used multiple times)\n",
|
||||||
#endif
|
#endif
|
||||||
" -i\t\tignores the autojoin list entries\n",
|
" -i\t\tignores the autojoin list entries\n",
|
||||||
#if defined(WINNT) || defined(__EMX__)
|
" -l <file>\tloads <file> in place of your " IRCRC_NAME "\n\
|
||||||
" -l <file>\tloads <file> in place of your irc-rc\n\
|
-L <file>\tloads <file> in place of your " IRCRC_NAME " and expands $ expandos\n",
|
||||||
-L <file>\tloads <file> in place of your irc-rc and expands $ expandos\n",
|
|
||||||
#else
|
|
||||||
" -l <file>\tloads <file> in place of your .ircrc\n\
|
|
||||||
-L <file>\tloads <file> in place of your .ircrc and expands $ expandos\n",
|
|
||||||
#endif
|
|
||||||
#if !defined(WINNT) && !defined(__EMX__)
|
#if !defined(WINNT) && !defined(__EMX__)
|
||||||
" -B\t\tforce BitchX to fork and return you to shell. pid check on.\n",
|
" -B\t\tforce BitchX to fork and return you to shell. pid check on.\n",
|
||||||
#endif
|
#endif
|
||||||
@@ -1133,18 +1120,12 @@ static char *parse_args (char *argv[], int argc, char **envp)
|
|||||||
fprintf(stderr, "Please restart IRC II with a valid nickname\n");
|
fprintf(stderr, "Please restart IRC II with a valid nickname\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ircrc_file == NULL)
|
if (ircrc_file == NULL)
|
||||||
{
|
ircrc_file = m_sprintf("%s/%s", my_path, IRCRC_NAME);
|
||||||
ircrc_file = (char *) new_malloc(strlen(my_path) + strlen(IRCRC_NAME) + 1);
|
|
||||||
strcpy(ircrc_file, my_path);
|
|
||||||
strcat(ircrc_file, IRCRC_NAME);
|
|
||||||
}
|
|
||||||
if (bircrc_file == NULL)
|
if (bircrc_file == NULL)
|
||||||
#if defined(WINNT) || defined(__EMX__)
|
bircrc_file = m_sprintf("%s/%s", my_path, BITCHXRC_NAME);
|
||||||
malloc_sprintf(&bircrc_file, "%s/bx-rc", my_path);
|
|
||||||
#else
|
|
||||||
malloc_sprintf(&bircrc_file, "%s/.bitchxrc", my_path);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((ptr = getenv("IRCPORT")))
|
if ((ptr = getenv("IRCPORT")))
|
||||||
irc_port = my_atol(ptr);
|
irc_port = my_atol(ptr);
|
||||||
|
|||||||
Reference in New Issue
Block a user