Package: indent Version: 2.2.10-1 Severity: important Hello,
In the second chapter of the "Unix haters" book (named "Welcome, New User!"), in the subchapter "Error Messages and Error Checking, NOT!" there is a quote of a message from Pavel Curtis sent in 1992 to the Unix haters mailing list. I am quoting a part from that message: ======================================== I attempt to type: % ident foo to see what versions of what source files are included in the execut- able. [Never mind that RCS is obviously the wrong thing or that the way “ident” works is unbelievably barbaric; I have bigger fish to fry...] Of course, though, on this occasion I mistyped as my fingers go on autopilot and prefer the word ‘indent’ to the non-word ‘ident:’ % indent foo Now, it turns out that “indent” is the name of UNIX’s brain-damaged idea of a prettyprinter for C. Did the bastard who wrote this abortion consider checking to make sure that its input was a C file (like, oh my god, checking for whether or not the name ended in “.c”)? I think you know the answer. Further, Said Bastard decided that if you give only one argument to indent then you must mean for the source code to be prettyprinted in place, overwriting the old contents of the file. But not to worry, SB knew you might be worried about the damage this might do, so SB made sure to save a copy of your old contents in foo.BAK. Did SB simply rename foo to foo.BAK? Of course not, far better to copy all of the bits out of foo into foo.BAK, then truncate the file foo, than to write out the new, prettyprinted file. Bastard. ======================================== Unfortunately, it seems that, 17 years later, the current indent command still is broken and fails to make proper backups, as this set of commands proves: 0 e...@twix /tmp/unixhaters $ cp /bin/bash . 0 e...@twix /tmp/unixhaters $ md5sum /bin/bash bash c8770eb0a3f2b6088914b4bc29301113 /bin/bash c8770eb0a3f2b6088914b4bc29301113 bash 0 e...@twix /tmp/unixhaters $ indent bash indent: bash:1: Warning:Warning: File bash contains NULL-characters indent: bash:1: Warning:Warning: File bash contains NULL-characters indent: bash:1: Warning:Warning: File bash contains NULL-characters indent: bash:1: Warning:Warning: File bash contains NULL-characters indent: bash:1: Warning:Warning: File bash contains NULL-characters indent: bash:1: Warning:Warning: File bash contains NULL-characters indent: bash:1: Warning:Warning: File bash contains NULL-characters indent: bash:1: Warning:Warning: File bash contains NULL-characters indent: bash:1: Warning:Warning: File bash contains NULL-characters indent: bash:1: Warning:Warning: File bash contains NULL-characters indent: bash:1: Warning:Warning: File bash contains NULL-characters indent: bash:1: Warning:Warning: File bash contains NULL-characters indent: bash:1: Warning:Warning: File bash contains NULL-characters indent: bash:1: Warning:Warning: File bash contains NULL-characters indent: bash:1: Warning:Warning: File bash contains NULL-characters indent: bash:1: Warning:Warning: File bash contains NULL-characters indent: bash:1: Warning:Warning: File bash contains NULL-characters indent: bash:1: Warning:Warning: File bash contains NULL-characters 0 e...@twix /tmp/unixhaters $ md5sum /bin/bash bash bash~ c8770eb0a3f2b6088914b4bc29301113 /bin/bash fdd37c28b05dfbe6317facfc72f3059e bash f0e8f38aa2e7c1e64ce367b934453e76 bash~ It would probably be a good idea to make sure that: - the original file is renamed instead of copied (badly) - the original file is a text file, more exactly a C file - the command stops if it seems the file is binary (or at least asks for a confirmation, if it detects such a situation) -- Regards, EddyP ============================================= "Imagination is more important than knowledge" A.Einstein -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org