5 ms·
I was hit by a similar bug back in Microsoft Visual Studio 6. The source code at the company I was at had mixed CR/LF throughout (switching from IRIX to Window
by VikingCoder 5y ago
I was hit by a similar bug back in Microsoft Visual Studio 6. The source code at the company I was at had mixed CR/LF throughout (switching from IRIX to Windows, and some stubborn folks continuing to use vi/emacs). And in this one instance, the MSVS6 Editor (and syntax highlighting) interpreted a comment followed by a line of code... but the MSVS6 compiler interpreted as a comment, followed by more characters on the same comment. Unfortunately the comment and line of code were something like this:
// don't forget to skip formatting the hard drive
format_hard_drive = false;
So, yes, the code in question deleted the user's hard drive. And by looking at the code in Visual Studio, the editor, you'd swear the code was correct.
(The real logic was not that blatantly dangerous, but it amounted to the same thing.)
- jackcviers3 5y agoWay to blame a bug in your editor on someone else's. Emacs autoconverts between the two line ending styles at open and close, unless you expressly tell it to do otherwise [1]. You had malicious editors using emacs. The editor wasn't the problem, the people using it were and they had to go out of their way to manage it. 1. https://www.emacswiki.org/emacs/EndOfLineTips#:~:text=(The%20carriage%2Dreturn%20character%2C,'C%2Dx%20C%2Dm%20r%20dos'%20 https://www.emacswiki.org/emacs/EndOfLineTips#:~:text=(The%2....
- VikingCoder 5y agoThe editor showed the behavior that we all intended. The compiler was the one that behaved differently from how we all expected. And we all used the same compiler. I was not "blaming someone else's editor," I was describing the situation. If someone created a file in emacs, and then someone else edited it in MSVS6, then apparently you could end up with some mixed CR, CR/LF, LF, LF/CR state, enough to confuse the compiler. PS - We all benefit when we give each other the benefit of the doubt, and hold off on the snark. And calling my co-workers "malicious" based on your limited understanding of the situation is not appreciated.
- gnufx 5y agoI don't know what date "Visual Studio 6" implies, but I'd been using Irix for a few years before GNU Emacs 20 and coding conversion; I can't speak for anything vi-le. Anyway, it's not uncommon to find mixed line endings even these days (which Emacs indicates).