Fail on Windows with long paths
Astyle fails on Windows for long pathnames, even when relative pathnames are used.
Example:
c:\Temp\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>prompt %
% astyle --version
Artistic Style Version 3.6.6
% echo int main() {} > foo.c
% type foo.c
int main() {}
% astyle foo.c
No file to process foo.c
Artistic Style has terminated
%
I suspect it might be because of getFullPathName
. Is there a reason astyle wants to convert relative pathnames like "foo.c" into absolute pathnames?
The reason this issue is interesting is because our build system uses conan which tends to like to use long pathnames. Workaround is to do something like copy the C sources to C:\Temp, run astyle, then copy the results back.
We could also argue that "No file to process" is somewhat misleading since the file does indeed exist but the error message implies otherwise.
Edited by Michael Cook