kiss-repository

personal kiss repository
git clone git://git.ckyln.com/~cem/kiss-repository.git
Log | Files | Refs | Submodules | README | LICENSE

nvi-27-support_C_locale.patch (1045B)


      1 #! /bin/sh /usr/share/dpatch/dpatch-run
      2 ## 27support_C_locale.dpatch by  <hesso@pool.math.tu-berlin.de>
      3 ##
      4 ## DP: Allow users to edit 8-bit files even under LC_CTYPE=C.
      5 
      6 @DPATCH@
      7 --- nvi-1.81.6.orig/common/conv.c	2007-11-18 17:41:42.000000000 +0100
      8 +++ nvi-1.81.6/common/conv.c	2009-03-09 16:45:37.812022582 +0100
      9 @@ -322,11 +322,16 @@
     10      else {
     11  	setlocale(LC_ALL, "");
     12  #ifdef USE_WIDECHAR
     13 -	sp->conv.sys2int = cs_char2int;
     14 -	sp->conv.int2sys = cs_int2char;
     15 -	sp->conv.file2int = fe_char2int;
     16 -	sp->conv.int2file = fe_int2char;
     17 -	sp->conv.input2int = ie_char2int;
     18 +	if (!strcmp(LANGCODESET, "ANSI_X3.4-1968")) {
     19 +	    sp->conv.file2int = sp->conv.input2int = sp->conv.sys2int = raw2int;
     20 +	    sp->conv.int2sys = sp->conv.int2file = int2raw;
     21 +	} else {
     22 +	    sp->conv.sys2int = cs_char2int;
     23 +	    sp->conv.int2sys = cs_int2char;
     24 +	    sp->conv.file2int = fe_char2int;
     25 +	    sp->conv.int2file = fe_int2char;
     26 +	    sp->conv.input2int = ie_char2int;
     27 +	}
     28  #endif
     29  #ifdef USE_ICONV
     30  	o_set(sp, O_FILEENCODING, OS_STRDUP, nl_langinfo(CODESET), 0);