Bug in unix2dos and dos2unix?

Posted by Linda on Mon 06 Jan 2003 12:31 AM — 5 posts, 22,766 views.

Sweden #0
Not quite a PennMUSH server issue, but related anyway.

I've always used unix2dos.exe and dos2unix.exe to convert my dbs when switching between my windows binary of Penn and Penn on the FreeBSD server we have our game out.

However, all of a sudden that isn't working any longer. Using unix2dos.exe on a db downloaded from the server causes the Windows binary to crash.

This seems to happen only with dbs saved under 1.7.7p3 (the most recent Penn release), but I don't know if the issue is something in my db (but it loads up fine if converted in a text editor) or something in the converters.
USA #1
Actually, with as many freeware programs as there are to read and save files in *nix format on a windows machine, the converters are largely defunct anyway. My personal favorite just because of the site its on is a lil notepad replacement called metapad. Metapad can be found at http://www.liquidninja.com/metapad - has no filesize limits and wont destroy formatting on *nix files when you open em on a windows machine. With any luck you can just outright replace notepad with it, though XP does seem to have issues with my attempts to do so :/ There are several other very nice free or nearly enough free programs with similar abilities for download if you'd prefer to search for something else. As for your problems cause, I've no clue since I dont deal with Penn or the converters but this is a viable solution if you choose to go with it.
Australia Forum Administrator #2
The converters are pretty simple, and shouldn't cause problems, and it is strange it has suddenly started happening.

What you could do is compare the converted file by my program, and the file converted by another utility and try to identify in what way they are working differently (eg. one extra blank line at the end).
Sweden #3
I've tried doing this manually, and I can't seem to find any difference between a file converted by the converters and by notepad program. Can the comparison be done automatically, somehow?

Definitely an odd situation, but I've tested it several times now, and a db converted with the converters always crashes the binary, leaving this error message in the log: DB: Garbage after quoted string, line 14

However, nothing like that can be found in the db.

Very odd.

Australia Forum Administrator #4
Crashes at line 14 eh? That makes it simple. Try sending me (by email, zipped up) ...

1. first 20 lines of the original file
2. first 20 lines of the file converted by unix2dos (or dos2unix, whichever is causing the problem)
3. first 20 lines of the file converted with your other program (please say which one it was).

I'll use my unix compare utilities, and other methods, to see the difference.