components/ksh93/patches/240-22461939.patch
changeset 5615 44d8b21d95e4
equal deleted inserted replaced
5614:12b0db03649b 5615:44d8b21d95e4
       
     1 This fix has been developed inhouse. Patch has been submitted upstream but 
       
     2 has not been accepted yet. The details can be found at
       
     3 https://github.com/att/ast/issues/6
       
     4 --- INIT.2012-08-01.old/src/cmd/ksh93/edit/emacs.c	2016-01-18 03:52:58.380801240 -0800
       
     5 +++ INIT.2012-08-01/src/cmd/ksh93/edit/emacs.c	2016-02-05 01:39:08.350312914 -0800
       
     6 @@ -90,6 +90,7 @@
       
     7      static int	print(int);
       
     8      static int	_isword(int);
       
     9  #   define  isword(c)	_isword(out[c])
       
    10 +#   define digit(c)	((c&~STRIP)==0 && isdigit(c))
       
    11  
       
    12  #else
       
    13  #   define gencpy(a,b)	strcpy((char*)(a),(char*)(b))
       
    14 @@ -97,6 +98,7 @@
       
    15  #   define genlen(str)	strlen(str)
       
    16  #   define print(c)	isprint(c)
       
    17  #   define isword(c)	(isalnum(out[c]) || (out[c]=='_'))
       
    18 +#   define digit(c)	isdigit(c)
       
    19  #endif /*SHOPT_MULTIBYTE */
       
    20  
       
    21  typedef struct _emacs_
       
    22 @@ -317,7 +319,7 @@
       
    23  			count = 1;
       
    24  		adjust = -1;
       
    25  		i = cur;
       
    26 -		if(c!='\t' && c!=ESC && !isdigit(c))
       
    27 +		if(c!='\t' && c!=ESC && !digit(c))
       
    28  			ep->ed->e_tabcount = 0;
       
    29  		switch(c)
       
    30  		{
       
    31 @@ -775,7 +777,7 @@
       
    32  	int digit,ch;
       
    33  	digit = 0;
       
    34  	value = 0;
       
    35 -	while ((i=ed_getchar(ep->ed,0)),isdigit(i))
       
    36 +	while ((i=ed_getchar(ep->ed,0)),digit(i))
       
    37  	{
       
    38  		value *= 10;
       
    39  		value += (i - '0');
       
    40 @@ -1013,7 +1015,7 @@
       
    41  				{
       
    42  					i=ed_getchar(ep->ed,0);
       
    43  					ed_ungetchar(ep->ed,i);
       
    44 -					if(isdigit(i))
       
    45 +					if(digit(i))
       
    46  						ed_ungetchar(ep->ed,ESC);
       
    47  				}
       
    48  			}