
Ask HN: How would you solve case mis-match in C++ includes? - Artlav
I came into possession of a large-ish C++ project (2000 files, 20 Mb of code) that i want to port to Linux.<p>The code is rather clean and not too OS-dependent, so i didn&#x27;t expect much problems. But straight away i ran into a show-stopper.<p>The files are all in rather random case - some are lowercase, some are camel-capitalized.<p>The #include statements in them are also in rather random case.<p>And the problem is that these two randoms are different randoms that rarely match.<p>Windows does not care about such things, but in Linux this matters.<p>So, how would you go about fixing something like that?<p>On one half, renaming a lot of files to lowercase is a matter of a simple bash script.<p>But on the other half it&#x27;s a matter of going through thousands of files and manually changing the case in #include to lowercase...<p>I was thinking of making a relatively simple CPP-like parser that would look for the right preprocessor statements and fix them, but first i&#x27;d like to know whether this bicycle have been invented already.<p>TL;DR: Is there an existing tool that can go through 2000 cpp and h files and change the #include &quot;...&quot; statements to lowercase?
======
Davidbrcz
Sed is not enough ?

