[srvx-commits] CVS: services/src helpfile.c,1.56,1.57
Brought to you by:
entrope
|
From: Entrope <en...@us...> - 2002-10-25 16:22:06
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv20896/src
Modified Files:
helpfile.c
Log Message:
don't crash if the requested help file is missing
Index: helpfile.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpfile.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -r1.56 -r1.57
*** helpfile.c 21 Sep 2002 21:51:30 -0000 1.56
--- helpfile.c 25 Oct 2002 13:03:52 -0000 1.57
***************
*** 26,29 ****
--- 26,30 ----
#define DEFAULT_LINE_SIZE MAX_LINE_SIZE
#define DEFAULT_TABLE_SIZE 80
+ #define HFMSG_MISSING_HELPFILE "The help file could not be found. Sorry!"
#define HFMSG_HELP_NOT_STRING "Help file error (help data was not a string)."
***************
*** 440,448 ****
const char *str;
if (!topic) topic = "<index>";
! if (hf) {
! rec = dict_find(hf->db, topic, NULL);
! } else {
! rec = NULL;
}
if (!rec) {
rec = dict_find(hf->db, "<missing>", NULL);
--- 441,449 ----
const char *str;
if (!topic) topic = "<index>";
! if (!hf) {
! _send_help(dest, src, NULL, HFMSG_MISSING_HELPFILE);
! return 0;
}
+ rec = dict_find(hf->db, topic, NULL);
if (!rec) {
rec = dict_find(hf->db, "<missing>", NULL);
|