Re: [htdig] bug in template_map ? and alternative to changehost

Claas Hilbrecht (
Wed, 3 Feb 1999 12:49:08 +0100

After playing around with the tips from the list I finally managed it. I
think there are several problems that caused my inital problems (file
permission, wrong names etc).

Thanks a lot for the help.

I've changed htsearch a little bit to display the host part of the url based
on "HTTP_HOST". Maybe someoneelse need this too:

In in function void Display::displayMatch() I replaced

vars.Add("URL", new String(url));


      char *ptr;
      char buff[4096];
      strcpy(buff, "Unbekannte URL");
      ptr = strstr(url, "http://");
          ptr = strchr(url+sizeof("http://"), '/');
              char *hostname;
              int len;

              hostname = getenv("HTTP_HOST");
                  strcpy(buff, "http://");
                  strcat(buff, hostname);
                strcpy(buff, "");

              len = strlen(buff) + strlen(ptr);
              if(len >= (sizeof(buff)-1))
                strcpy(buff, "URL zu lang für die Anzeige.");
                strcat(buff, ptr);
      ptr = buff;
      vars.Add("URL", new String(ptr));

Mit freundlichem Gruss
Claas Hilbrecht

Linum Software GmbH
Tel: 05561-971070
Fax: 05561-971071
To unsubscribe from the htdig mailing list, send a message to containing the single word "unsubscribe" in
the SUBJECT of the message.

This archive was generated by hypermail 2.0b3 on Wed Feb 10 1999 - 17:09:05 PST