lichray / nvi2

A multibyte fork of the nvi editor for BSD
Other
144 stars 34 forks source link

Undo `do {} while (0)` changes #88

Closed dankm closed 4 years ago

dankm commented 4 years ago

In this file, the macros include loop control statements continue. Adding do {} while (0) to these macros breaks the main for loop of the function. Remove them.

This partially reverts commit 05ed8b9b4016928e161d3d889bc1c443ce1d72dd.

dankm commented 4 years ago

For a comparison, here's the old (before this change) output of ./dump ../cl/*.c ../common/*.c ../ex/*.c ../vi/*.c|vis|head -5:

"u\M-e\M-k|\^O\^_\000A\M^KG\^H\M^MH\M^?A\M^IO\^H\M^E\M-@~\^TI\M^K\^GH\M^MH\^AI\M^I\^O\^O\M-6\000\M^C\M-x"
"u\M-0\M^C|\M-i'\000\000\000t'L\M^I\M^?\M-h_\^E\000\000A\M^I\M-D\M^C\M-x\M^?\^O\M^DS\M^?\M^?\M^?\M^C=\M-L'\000\000\000t-L\M^I\M^?\M-hB\^E\000\000\M-kJA\M^KO\^H\M^MA\M^?A\M^IG\^H\M^E\M-I\^O\M^N\^Y\^B\000\000I\M^K\^OH\M^MQ\^AI\M^I\^WD\^O\M-6!\M-k\^DA\M^KG\^H\M^MH\M^?A\M^IO\^H\M^E\M-@~\^PI\M^K\^GH\M^MP\^AI\M^I\^WD\^O\M-6(\M-k+L\M^I\M^?\M-h\^F\^E\000\000A\M^I\M-E\M^C\M-x\M^?\^O\M^D\M-j\M-~\M^?\M^?\M^C=c'\000\000\000t
L\M^I\M^?\M-h\M-Y\^D\000\000\M-k'A\M^KO\^H\M^MA\M^?A\M^IG\^H\M^E\M-I~\^PI\M^K\^OH\M^MQ\^AI\M^I\^WD\^O\M-61\M-k3L\M^I\M^?\M-h\M-@\^D\000\000A\M^I\M-F\M^C\M-x\M^?\^O\M^D\M-$\M-~\M^?\M^?\M^C=\^]'\000\000\000t\^RL\M^I\M^?\M-h\M^S\^D\000\000\M^C\M-x\M^?u2\M-i\M^I\M-~\M^?\M^?A\M^KG\^H\M^MH\M^?A\M^IO\^H\M^E\M-@~\^MI\M^C\^G\^AH\M^K5\M^?&\000\000\M-k-L\M^I\M^?\M-hu\^D\000\000\M^C\M-x\M^?\^O\M^D\134\M-~\M^?\M^?\M^C=\M-U&\000\000\000H\M^K5\M-^&\000\000t\^L\M-?"
"\M^C=\M^V|\000\000\000H\M^K5\M^_&\000\000t
D\M^I\M-g\M-h%\^D\000\000\M-k-\M^KF\^L\M^MH\M^?\M^IN\^L\M^E\M-@\^?\^SA\M^@\M-|

And here's the new:

"323|Invalid input. Truncated."
"016|Vi's standard input and output must be a terminal"
"233|This terminal has no %s key"
"046|messages not turned on: %s"
"045|messages not turned off: %s"
lichray commented 4 years ago

Oops, thanks for the fix!