From 91ccd2728e9df26ceaeca0096f4445c61ba44371 Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 4 Jul 2002 10:38:49 +0000 Subject: [PATCH] [project @ 2002-07-04 10:38:49 by simonmar] In hPutLitString, catch the empty string case before calling hPutBuf. Some older versions of hPutBufFull choke on a zero-length buffer. Fixes occasional problems with the Sparc native code generator, which uses SLIT("") in a couple of places. --- ghc/compiler/utils/Pretty.lhs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ghc/compiler/utils/Pretty.lhs b/ghc/compiler/utils/Pretty.lhs index d3fe50a..bf7f10b 100644 --- a/ghc/compiler/utils/Pretty.lhs +++ b/ghc/compiler/utils/Pretty.lhs @@ -1037,6 +1037,8 @@ printDoc mode hdl doc hPutBuf = hPutBufFull #endif + -- some versions of hPutBuf will barf if the length is zero +hPutLitString handle a# 0# = return () hPutLitString handle a# l# #if __GLASGOW_HASKELL__ < 411 = hPutBuf handle (A# a#) (I# l#) -- 1.7.10.4