components/ksh93/patches/CR7026179.patch
changeset 789 5f074ca23733
equal deleted inserted replaced
788:ab1a623335b6 789:5f074ca23733
       
     1 --- a/src/lib/libcmd/wclib.c	Tue Dec  1 17:10:57 2009
       
     2 +++ b/src/lib/libcmd/wclib.c	Wed Jun 29 15:22:42 2011
       
     3 @@ -18,6 +18,9 @@
       
     4  *                  David Korn <[email protected]>                   *
       
     5  *                                                                      *
       
     6  ***********************************************************************/
       
     7 +/*
       
     8 + * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
       
     9 + */
       
    10  #pragma prototyped
       
    11  /*
       
    12   * David Korn
       
    13 @@ -341,7 +344,9 @@
       
    14  		int		xspace;
       
    15  		int		wasspace = 1;
       
    16  		unsigned char*	start;
       
    17 +		int             flagm = 0;
       
    18  
       
    19 +
       
    20  		lastchar = 0;
       
    21  		start = (endbuff = side) + 1;
       
    22  		xspace = iswspace(0xa0) || iswspace(0x85);
       
    23 @@ -367,6 +372,7 @@
       
    24  			if(mbc(lasttype))
       
    25  			{
       
    26  				c = lasttype;
       
    27 +				flagm = 1;
       
    28  				goto mbyte;
       
    29  			}
       
    30  			if(!lasttype && spc(type[*cp]))
       
    31 @@ -415,6 +421,18 @@
       
    32  							skip = (c&7);
       
    33  							adjust += skip;
       
    34  							state = 0;
       
    35 +							if (flagm == 1) {
       
    36 +								flagm = 0;
       
    37 +								oldc = *cp;
       
    38 +								if (xspace && (
       
    39 +								    iswspace
       
    40 +								    (*cp)
       
    41 +								    == 1)) {
       
    42 +									state
       
    43 +									    = 8;
       
    44 +								}
       
    45 +								continue;
       
    46 +							}
       
    47  							if(skip==2 && (cp[-1]&0xc)==0 && (state=(cp[-1]&0x3)))
       
    48  								oldc = *cp;
       
    49  							else if(xspace && cp[-1]==0xc2)