Index: plugins/check_http.c =================================================================== RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_http.c,v retrieving revision 1.13 diff -c -r1.13 check_http.c *** plugins/check_http.c 19 Dec 2002 19:20:25 -0000 1.13 --- plugins/check_http.c 13 Jan 2003 03:52:29 -0000 *************** *** 44,50 **** \(-H | -I ) [-u ] [-p ]\n\ [-w ] [-c ] [-t ] [-L]\n\ [-a auth] [-f ] [-e ]\n\ ! [-s string] [-r | -R ]\n\ [-P string]" #define LONGOPTIONS "\ --- 44,50 ---- \(-H | -I ) [-u ] [-p ]\n\ [-w ] [-c ] [-t ] [-L]\n\ [-a auth] [-f ] [-e ]\n\ ! [-s string] [-l] [-r | -R ]\n\ [-P string]" #define LONGOPTIONS "\ *************** *** 75,80 **** --- 75,82 ---- Wrap output in HTML link (obsoleted by urlize)\n\ -f, --onredirect=\n\ How to handle redirected pages\n%s\ + -l, --linespan\n\ + Allow regex to span newlines (must precede -r or -R)\n\ -v, --verbose\n\ Show details for command-line debugging (do not use with nagios server)\n\ -h, --help\n\ *************** *** 286,291 **** --- 288,294 ---- {"regex", required_argument, 0, 'r'}, {"ereg", required_argument, 0, 'r'}, {"eregi", required_argument, 0, 'R'}, + {"linespan", no_argument, 0, 'l'}, {"onredirect", required_argument, 0, 'f'}, {"certificate", required_argument, 0, 'C'}, {0, 0, 0, 0} *************** *** 308,314 **** strcpy (argv[c], "-n"); } ! #define OPTCHARS "Vvht:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nLS" while (1) { #ifdef HAVE_GETOPT_H --- 311,317 ---- strcpy (argv[c], "-n"); } ! #define OPTCHARS "Vvht:c:w:H:P:I:a:e:p:s:R:r:lu:f:C:nLS" while (1) { #ifdef HAVE_GETOPT_H *************** *** 420,434 **** server_expect[MAX_INPUT_BUFFER - 1] = 0; server_expect_yn = 1; break; case 'R': /* regex */ ! #ifdef HAVE_REGEX_H ! cflags = REG_ICASE; ! #else usage ("check_http: call for regex which was not a compiled option\n"); ! #endif case 'r': /* regex */ ! #ifdef HAVE_REGEX_H cflags |= REG_EXTENDED | REG_NOSUB | REG_NEWLINE; strncpy (regexp, optarg, MAX_RE_SIZE - 1); regexp[MAX_RE_SIZE - 1] = 0; errcode = regcomp (&preg, regexp, cflags); --- 423,444 ---- server_expect[MAX_INPUT_BUFFER - 1] = 0; server_expect_yn = 1; break; + #ifndef HAVE_REGEX_H + case 'l': /* linespan */ case 'R': /* regex */ ! case 'r': /* regex */ usage ("check_http: call for regex which was not a compiled option\n"); ! break; ! #else ! case 'l': /* linespan */ ! cflags &= ~REG_NEWLINE; ! break; ! case 'R': /* regex */ ! cflags |= REG_ICASE; case 'r': /* regex */ ! /* this is not required here, as it's initialized cflags |= REG_EXTENDED | REG_NOSUB | REG_NEWLINE; + */ strncpy (regexp, optarg, MAX_RE_SIZE - 1); regexp[MAX_RE_SIZE - 1] = 0; errcode = regcomp (&preg, regexp, cflags); *************** *** 437,446 **** printf ("Could Not Compile Regular Expression: %s", errbuf); return ERROR; } - #else - usage ("check_http: call for regex which was not a compiled option\n"); - #endif break; case 'v': /* verbose */ verbose = TRUE; break; --- 447,454 ---- printf ("Could Not Compile Regular Expression: %s", errbuf); return ERROR; } break; + #endif case 'v': /* verbose */ verbose = TRUE; break;