TC can't handle descript.ion files with lines that end in LF

Please report only one bug per message!

Moderators: Stefan2, white, sheep, Hacker

Post Reply
Gooberslot
Junior Member
Junior Member
Posts: 22
Joined: 2003-09-20, 04:30 UTC

TC can't handle descript.ion files with lines that end in LF

Post by *Gooberslot » 2016-01-12, 15:53 UTC

Total Commander can't properly handle descript.ion files that have Unix line endings of only a line feed. When copying files with a descript.ion file formatted like that it only appears to copy every other file's comment. When I changed the line endings to CRLF the file comments were copied correctly.

User avatar
Horst.Epp
Power Member
Power Member
Posts: 3308
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp » 2016-01-12, 16:19 UTC

We are on Windows and so are the line endings of text files

Gooberslot
Junior Member
Junior Member
Posts: 22
Joined: 2003-09-20, 04:30 UTC

Post by *Gooberslot » 2016-01-13, 09:09 UTC

The only specification for the descript.ion format I could find said that an application should be able to handle any line endings. I have no idea which application created these descript.ion files (it clearly wasn't TC) but TC should be able to properly handle them.

Gooberslot
Junior Member
Junior Member
Posts: 22
Joined: 2003-09-20, 04:30 UTC

TC can't handle descript.ion files with lines that end in LF

Post by *Gooberslot » 2016-01-14, 03:23 UTC

I originally posted this in the wrong forum so now I'm posting it here, in the correct forum. Sorry for my mistake.

Total Commander can't properly handle descript.ion files that have Unix line endings of only a line feed. When copying files with a descript.ion file formatted like that it only appears to copy every other file's comment. When I changed the line endings to CRLF the file comments were copied correctly.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37264
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2016-01-14, 11:24 UTC

The official specs are here:
http://jpsoft.com/ascii/descfile.txt

The specs require <CR>>LF> line endings:
Each line is in the following format:

filename.ext Description[*<ID>Other program info]...<CR><LF>
I will check how difficult it would be to support Linux or Mac line breaks.
Author of Total Commander
http://www.ghisler.com

Gooberslot
Junior Member
Junior Member
Posts: 22
Joined: 2003-09-20, 04:30 UTC

Post by *Gooberslot » 2016-01-17, 04:22 UTC

From the specs you posted:

"Your program should be able to handle a line terminated by a
CR or LF alone, a CR/LF pair, an EOF (ASCII 26), or the physical end of
the file."

It sounds like even though the specs call for a CRLF ending your program should be able to gracefully handle other line endings.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37264
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2016-01-18, 10:36 UTC

I checked it - it was indeed a bug: TC can read one comment from such a file, but then reading of comments further down in the file will fail.
Author of Total Commander
http://www.ghisler.com

Post Reply