I think I got the type casting right this time, but I still
don't know if it works... I'll set up a chroot with ghc 6.4
on friday to verify it.
Thu Nov 24 12:49:15 CET 2005 Tommy Pettersson <[EMAIL PROTECTED]>
* use isprint from libc when escaping output to terminals
New patches:
[use isprint from libc when escaping output to terminals
Tommy Pettersson <[EMAIL PROTECTED]>**20051124114915]
<
> {
hunk ./ColourPrinter.lhs 2
\begin{code}
+{-# OPTIONS -fffi #-}
module ColourPrinter ( fancyPrinters ) where
import External (getTermNColors)
import Printer (Printer, Printers(..), Printable(..), Color(..),
hunk ./ColourPrinter.lhs 16
import System.IO.Unsafe ( unsafePerformIO )
import System.IO ( hIsTerminalDevice, stdout )
+{-
+Since GHC 2.4 the library function isPrint uses unicode only,
+but the C library function isprint reflects the locale setting.
+This is important for correctly escaping of non-printables when
+printing with support for 8-bit locales.
+-}
+import Foreign
+import Foreign.C ( CInt )
+foreign import ccall "ctype.h isprint" c_isprint :: CInt -> CInt
+localeIsprint :: Char -> Bool
+localeIsprint = (/=0) . c_isprint . fromIntegral . ord
+
dollar, cr :: Doc
dollar = unsafeBoth "$" (packString "$")
cr = unsafeBoth "\r" (packString "\r")
hunk ./ColourPrinter.lhs 172
no_escape po c | c `elem` poNoEscX po = True
no_escape _ '\t' = True -- tabs will likely be converted to spaces
no_escape _ '\n' = True
-no_escape po c = if (poIsprint po) then isPrint c
+no_escape po c = if (poIsprint po) then localeIsprint c
else isPrintableAscii c
|| c >= '\x80' && po8bit po
}
Context:
[remove tabs from darcs source file
Tommy Pettersson <[EMAIL PROTECTED]>**20051120200002]
[Added a test for changes --context patch selection.
Daniel Bünzli <[EMAIL PROTECTED]>**20051120170157]
[Emacs ediff-merge example and explanation of --external-merge.
Dave Love <[EMAIL PROTECTED]>**20051117154924]
[Fix patch selection for command changes --context
Daniel Bünzli <[EMAIL PROTECTED]>**20051117145112]
[fix bug in amInRepository.
David Roundy <[EMAIL PROTECTED]>**20051117131208
This is the bug that causes issue9. I'm a bit uncertain about this
patch--it looks obvious, but this is pretty subtle code.
]
[fix bug where darcs tries to delete open tempfile on win32
Will <[EMAIL PROTECTED]>**20051117023516]
[bump version to 1.0.5rc1
Tommy Pettersson <[EMAIL PROTECTED]>**20051117111128]
[Fixed documentation of DARCS_GET_HTTP with curl.
Daniel Bünzli <[EMAIL PROTECTED]>**20051117062547]
[add --dont-edit-description opposite to --edit-description.
David Roundy <[EMAIL PROTECTED]>**20051116115632]
[Flag superfluous input using Test::Builder
Florian Weimer <[EMAIL PROTECTED]>**20051112160533
This change makes sure that the test case that triggers this error
condition fails in a clean way (especially if test planning is not used,
but it should work with plans as well).
]
[English and markup fixes.
Dave Love <[EMAIL PROTECTED]>**20051114224845]
[update web page to reflect 1.0.4 as latest stable source.
David Roundy <[EMAIL PROTECTED]>**20051113210144]
[TAG 1.0.4
David Roundy <[EMAIL PROTECTED]>**20051113134431]
Patch bundle hash:
395f0288646d3c71ca4957643f34820a2e0b0ac6
_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel