2007-01-12 17:45:13 +01:00
|
|
|
--- src/cmd/ksh93/bltins/test.c
|
2016-10-12 13:36:28 +02:00
|
|
|
+++ src/cmd/ksh93/bltins/test.c 2011-05-20 13:45:25.000000000 +0000
|
|
|
|
@@ -47,12 +47,12 @@
|
2007-01-12 17:45:13 +01:00
|
|
|
#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
|
2016-10-12 13:36:28 +02:00
|
|
|
@@ -87,7 +87,7 @@ static int test_strmatch(Shell_t *shp,co
|
|
|
|
regoff_t match[2*(MATCH_MAX+1)],n;
|
2007-01-12 17:45:13 +01:00
|
|
|
register int c, m=0;
|
|
|
|
register const char *cp=pat;
|
|
|
|
- while(c = *cp++)
|
|
|
|
+ while((c = *cp++))
|
|
|
|
{
|
|
|
|
if(c=='(')
|
|
|
|
m++;
|
2016-10-12 13:36:28 +02:00
|
|
|
@@ -463,7 +463,7 @@ int test_unop(Shell_t *shp,register int
|
2007-01-12 17:45:13 +01:00
|
|
|
|
2011-09-02 14:19:30 +02:00
|
|
|
int test_binop(Shell_t *shp,register int op,const char *left,const char *right)
|
2007-01-12 17:45:13 +01:00
|
|
|
{
|
|
|
|
- register double lnum,rnum;
|
|
|
|
+ register double lnum = 0, rnum = 0;
|
|
|
|
if(op&TEST_ARITH)
|
|
|
|
{
|
|
|
|
while(*left=='0')
|