Skip to content
Snippets Groups Projects
Commit 1289048e authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel :man_dancing:
Browse files

Fix bad '... \\' escape in ghcversion.h generation

Today I learned about the peculiarities of escaping within
single-quotes:

Turns out,

  echo 'foo \\'

emits

  foo \\

rather than escaping the '\'. Curiously, if you need to escape a '
within single-quotes, here's how to do it

  echo 'foo '\'' bar'

which will emit

  foo ' bar

This fixes #10002
parent ff4733f4
No related merge requests found
......@@ -71,12 +71,12 @@ $(includes_H_VERSION) : mk/project.mk | $$(dir $$@)/.
echo "#define __GLASGOW_HASKELL_PATCHLEVEL2__ $(ProjectPatchLevel2)" >> $@; \
fi
@echo >> $@
@echo '#define MIN_VERSION_GLASGOW_HASKELL(ma,mi,pl1,pl2) (\\' >> $@
@echo ' ((ma)*100+(mi)) < __GLASGOW_HASKELL__ || \\' >> $@
@echo ' ((ma)*100+(mi)) == __GLASGOW_HASKELL__ \\' >> $@
@echo ' && (pl1) < __GLASGOW_HASKELL_PATCHLEVEL1__ || \\'>> $@
@echo ' ((ma)*100+(mi)) == __GLASGOW_HASKELL__ \\' >> $@
@echo ' && (pl1) == __GLASGOW_HASKELL_PATCHLEVEL1__ \\' >> $@
@echo '#define MIN_VERSION_GLASGOW_HASKELL(ma,mi,pl1,pl2) (\' >> $@
@echo ' ((ma)*100+(mi)) < __GLASGOW_HASKELL__ || \' >> $@
@echo ' ((ma)*100+(mi)) == __GLASGOW_HASKELL__ \' >> $@
@echo ' && (pl1) < __GLASGOW_HASKELL_PATCHLEVEL1__ || \' >> $@
@echo ' ((ma)*100+(mi)) == __GLASGOW_HASKELL__ \' >> $@
@echo ' && (pl1) == __GLASGOW_HASKELL_PATCHLEVEL1__ \' >> $@
@echo ' && (pl2) <= __GLASGOW_HASKELL_PATCHLEVEL2__ )' >> $@
@echo >> $@
@echo "#endif /* __GHCVERSION_H__ */" >> $@
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment