Re: htdig: (Not) translating entities


Marjolein Katsma (webmaster@javawoman.com)
Tue, 12 Jan 1999 20:33:15 +0100


At 13:49 1999-01-12 -0500, you wrote:
>
>On Tue, 12 Jan 1999, Marjolein Katsma wrote:
>
>> your visitor's language. I found this in the mail list archives; about a
>> year ago - can't remember the name of the poster. Can't think why it didn't
>> make it into the distribution but I found it useful.
>
>I picked a patch that supplies the filename if no title is found. I
>thought this was more appropriate. As always, I'm open to comments. May
>the best patch win. ;-)

Not a bad solution either - but again not configurable. I like things to be
configurable (as you must have noticed by now ;-)).

How about this idea:
- keep my configuration parameter
- change the *interpretation* so that if the parameter is set to "filename"
(as a literal string and default) it will substitute the file name; for any
other text it will use that text instead (somewhat similar as is used now
for format--template matching in template_map).

>
>> However, I don't really think your solution is necessarily 'better'. A
>> better solution would be to extend the String class with a compare method
>> that accepts a "string" (a char *) as a parameter rather than another
>> String object. More object-oriented and more encapsulated. You could then
>> simply write:
>> if ( entity.compare("lt") == 0 ) ....
>
>Yes, this was the suggestion I was going to make. The "new String"
>portions of your patch are definitely memory leaks (albeit small ones).

I'll look into doing that but I'm getting pressed for time myself by now.
So far I've concentrated on making things work rather than writing 'clean'
code... (I prefer the latter, of course, but I do have priorities that
pevent me from doing this right now).

One thing I cannot estimate is just how large / small the memory leak would
be in this case and when it would become an actual problem (surely all
memory is released when the program terminates?)

>
>-Geoff Hutchison
>Williams Students Online
>http://wso.williams.edu/
>

Marjolein Katsma webmaster@javawoman.com
Java Woman - http://javawoman.com/
----------------------------------------------------------------------
To unsubscribe from the htdig mailing list, send a message to
htdig-request@sdsu.edu containing the single word "unsubscribe" in
the body of the message.



This archive was generated by hypermail 2.0b3 on Wed Jan 13 1999 - 09:13:06 PST