The problem I reported almost a year ago still haven't been fixed in
monshow - the line number still doesn't show up if a parsing error is
returned. This patch corrects that, and also moves the RCFILE location to
the top of the script, so that the hardcoded entry isn't embedded deep in
the guts.

% diff -c monshow.orig monshow
*** monshow.orig        Thu Aug 23 18:26:46 2001
--- monshow     Thu Aug 23 19:06:44 2001
***************
*** 54,59 ****
--- 54,60 ----
  #
  # set this to the path of your view configuration files
  #
+ my $RCFILE = "/etc/mon/monshowrc";
  my $VIEWPATH = "/etc/mon/monshow";

  my %OPSTAT = %Mon::Client::OPSTAT;
***************
*** 129,135 ****
  #
  # read config file
  #
! my ($e, $what) = read_cf ($CF);

  if ($e ne "")
  {
--- 130,136 ----
  #
  # read config file
  #
! my ($e, $what) = read_cf ($CF,$RCFILE);

  if ($e ne "")
  {
***************
*** 347,359 ****
  sub read_cf
  {
      my $CF = shift;

      my ($group, $service);
      my @RC;
      my $view = 0;

-     my $RC = "/etc/mon/monshowrc";
-
      if ($CGI)
      {
        if ($ENV{"PATH_INFO"} =~ /^\/\S+/)
--- 348,359 ----
  sub read_cf
  {
      my $CF = shift;
+     my $RC = shift;

      my ($group, $service);
      my @RC;
      my $view = 0;

      if ($CGI)
      {
        if ($ENV{"PATH_INFO"} =~ /^\/\S+/)
***************
*** 519,525 ****
            {
                my $lnum = $.;
                close (IN);
!               err_die ("error in config file, line $.");
            }
        }
        close (IN);
--- 519,525 ----
            {
                my $lnum = $.;
                close (IN);
!               err_die ("error in config file, line $lnum");
            }
        }
        close (IN);


-- 
Joe Rhett                                                      Chief Geek
[EMAIL PROTECTED]                                      ISite Services, Inc.

Reply via email to