46 lines
1.8 KiB
Plaintext
46 lines
1.8 KiB
Plaintext
|
--- src/cmd/ksh93/bltins/test.c
|
||
|
+++ src/cmd/ksh93/bltins/test.c 2007-01-12 12:19:48.000000000 +0000
|
||
|
@@ -59,12 +59,12 @@ typedef unsigned long Time_t;
|
||
|
#ifdef S_ISSOCK
|
||
|
# if _pipe_socketpair
|
||
|
# if _socketpair_shutdown_mode
|
||
|
-# define isapipe(f,p) (test_stat(f,p)>=0&&S_ISFIFO((p)->st_mode)||S_ISSOCK((p)->st_mode)&&(p)->st_ino&&((p)->st_mode&(S_IRUSR|S_IWUSR))!=(S_IRUSR|S_IWUSR))
|
||
|
+# define isapipe(f,p) (test_stat(f,p)>=0&&(S_ISFIFO((p)->st_mode)||(S_ISSOCK((p)->st_mode)&&(p)->st_ino&&((p)->st_mode&(S_IRUSR|S_IWUSR))!=(S_IRUSR|S_IWUSR))))
|
||
|
# else
|
||
|
-# define isapipe(f,p) (test_stat(f,p)>=0&&S_ISFIFO((p)->st_mode)||S_ISSOCK((p)->st_mode)&&(p)->st_ino)
|
||
|
+# define isapipe(f,p) (test_stat(f,p)>=0&&(S_ISFIFO((p)->st_mode)||S_ISSOCK((p)->st_mode)&&(p)->st_ino))
|
||
|
# endif
|
||
|
# else
|
||
|
-# define isapipe(f,p) (test_stat(f,p)>=0&&S_ISFIFO((p)->st_mode)||S_ISSOCK((p)->st_mode)&&(p)->st_ino)
|
||
|
+# define isapipe(f,p) (test_stat(f,p)>=0&&(S_ISFIFO((p)->st_mode)||S_ISSOCK((p)->st_mode)&&(p)->st_ino))
|
||
|
# endif
|
||
|
# define isasock(f,p) (test_stat(f,p)>=0&&S_ISSOCK((p)->st_mode))
|
||
|
#else
|
||
|
@@ -99,7 +99,7 @@ static int test_strmatch(const char *str
|
||
|
int match[2*(MATCH_MAX+1)],n;
|
||
|
register int c, m=0;
|
||
|
register const char *cp=pat;
|
||
|
- while(c = *cp++)
|
||
|
+ while((c = *cp++))
|
||
|
{
|
||
|
if(c=='(')
|
||
|
m++;
|
||
|
@@ -305,7 +305,7 @@ skip:
|
||
|
cp = nxtarg(tp,0);
|
||
|
if(!op)
|
||
|
errormsg(SH_DICT,ERROR_exit(2),e_badop,binop);
|
||
|
- if(op==TEST_AND | op==TEST_OR)
|
||
|
+ if(op==TEST_AND || op==TEST_OR)
|
||
|
tp->ap--;
|
||
|
return(test_binop(op,arg,cp));
|
||
|
}
|
||
|
@@ -436,7 +436,7 @@ int test_unop(register int op,register c
|
||
|
|
||
|
int test_binop(register int op,const char *left,const char *right)
|
||
|
{
|
||
|
- register double lnum,rnum;
|
||
|
+ register double lnum = 0, rnum = 0;
|
||
|
if(op&TEST_ARITH)
|
||
|
{
|
||
|
while(*left=='0')
|