1. Re: Bug in EE

Robert wrote:

>Are you reading David? I tried:
>
>junk.ex:
>puts(1, "line1\nline2")   -- missing final \n
>
>ex junk >junk.dat
>
>ex ee junk.dat
>
>and found the '2' in line2 was missing.
>

As Robert Pilkington wrote:

>Notice how the last character is chopped off? It's=20
>an assumed \n. In the case of a last line without=20
>a \n, as Rob just showed, the entire line is
>read, but there isn't any \n to read, so it isn't added.=20
>The code should do something like this (but would be slower,=20
>seeing as it would only do anything on the last line, but we=20
>don't know where the last line is, so we always need to do the=20
>check):

I'll make a note to put the check back in. You do-it-yourselfers can =
find the code in the detab_text() function in XLE.E. It's a trivial =
test.

It's another example of stuff "falling out" after waffling back and =
forth. The original code didn't check for an newline, then I added the =
check, then people wanted the file load to go faster (Rob correctly =
pointed out that the line display is the most expensive part)... By now, =
I've forgotten if I left the test out intentionally, or not.

Thanks!

-- David Cuny

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu