]> granicus.if.org Git - graphviz/commitdiff
plugin/core: make awk crlf agnostic when generating ps.h
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Thu, 12 Aug 2021 20:02:48 +0000 (22:02 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Wed, 8 Sep 2021 16:35:34 +0000 (18:35 +0200)
Fixes errors like this with Cygwin in a crlf environment with
SHELLOPTS=igncr:

/cygdrive/c/Users/magja/graphviz/build/plugin/core/ps.h:2:1: error: missing terminating " character
    2 | "%%BeginProlog ",
      | ^~~~~~~~~~~~~~

Although not shown in the error message, this line actually contained
a carriage return after %%BeginProlog:

"%%BeginProlog\r",

plugin/core/CMakeLists.txt

index c717bf9841784ce911b7d0c59c3d828167ff3a96..0fd75b88a30b8ba84def94532af9c1e98134a26e 100644 (file)
@@ -2,7 +2,7 @@
 add_custom_command(
     OUTPUT ps.h
     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ps.txt
-    COMMAND ${AWK_EXECUTABLE} -f ${TOP_SOURCE_DIR}/awk/stringize.awk
+    COMMAND ${AWK_EXECUTABLE} -v RS="\\r*\\n" -f ${TOP_SOURCE_DIR}/awk/stringize.awk
             ${CMAKE_CURRENT_SOURCE_DIR}/ps.txt > ${CMAKE_CURRENT_BINARY_DIR}/ps.h
 )