Re: [htdig] Newlines in config (was Cannot get htdig to see

Subject: Re: [htdig] Newlines in config (was Cannot get htdig to see
From: Gilles Detillieux (
Date: Thu Aug 31 2000 - 10:11:25 PDT

According to Geoff Hutchison:
> On Wed, 30 Aug 2000, Gilles Detillieux wrote:
> > > that this is a bit different from the previous user (since I am using a
> > > variable), should I simply have wrapped the ${common_dir}/header/arts.html
> > > in single quotes?
> >
> > If you're using a Mac-based text editor, you're asking for trouble,
> > as the Mac uses a different text file format.
> Hey! That's not true--most good Mac text editors can save with UNIX
> linebreaks. Furthermore, actual PC text editors usually save with yet
> another style of linebreaks.

OK, no holy wars intended. I only mentioned it because a few months
back someone did run into problems for this very reason. He edited on
a Mac, saved in the Mac's text file format (CR line terminators), and
did a binary transfer, rather than a text transfer, to his UNIX box.
htdig choked on it. It took a long time to get to the bottom of the
problem because whenever he e-mailed excerpts from his config file,
the correct line breaks got reinserted by his Mac e-mail software.
It wasn't until I got him to uuencode the file on his UNIX box and e-mail
it to me that I discovered the problem.

> But it really shouldn't matter. The code splits on all sorts of line
> breaks, so I can't see how this would change anything. Still, I think
> Gilles is right--there was probably something wrong with the config file
> before you added the newline.
> If you take out the newline now, does it break?
> (This is always a troubleshooting trick.)

But it does matter. The 3.1.5 code will strip both CF and LF from the
end of each line, but it still uses istream::getline() to get lines from
the file, and this requires a "\n" (i.e. LF) to mark the line endings.
So, DOS and Windows formats are OK, UNIX format is OK, but Mac text
files with just CR delimiters won't work unless you change the delimiters.

I'm not 100% certain about this, but I suspect the 3.2 code will be even
pickier about this. I see lots of \n characters in conf_lexer.lxx,
but no \r characters, so I have a hunch that it will either choke on
them or append CRs to your attribute values if you have CR/LF terminators.

However, if the problem that Chris had was not due to CR delimiters, and
we now know that the extra newlines make no difference, then there must
have been some other characters causing problems before. There weren't
backslashes at the ends of lines before, were there?

Gilles R. Detillieux              E-mail: <>
Spinal Cord Research Centre       WWW:
Dept. Physiology, U. of Manitoba  Phone:  (204)789-3766
Winnipeg, MB  R3E 3J7  (Canada)   Fax:    (204)789-3930

------------------------------------ To unsubscribe from the htdig mailing list, send a message to You will receive a message to confirm this. List archives: <> FAQ: <>

This archive was generated by hypermail 2b28 : Thu Aug 31 2000 - 10:12:51 PDT