From d6e18a926605970067ac0e7347b78647dc2c52ae Mon Sep 17 00:00:00 2001 From: Olaf Barthel Date: Fri, 22 Sep 2006 07:54:25 +0000 Subject: [PATCH] - If defined, the local environment variable "DISABLE_COMMANDLINE_WILDCARD_EXPANSION" will disable expansion of wildcard patterns passed on the command line. Note that if the variable is not set then the global variable '__expand_wildcard_args' will provide the defaults for the switch that controls whether the wildcard expansion takes place. And after the environment variable has been checked, the '__expand_wildcard_args_check' function pointer can still be used to override the switch. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15141 87f5fb63-7c3d-0410-a384-fd976d0f7a62 --- library/changes | 8 ++++++++ library/include/dos.h | 6 +++++- library/math_atan2.c | 4 ++-- library/math_exp.c | 4 ++-- library/math_kernel_expm1.c | 4 ++-- library/math_sqrt.c | 4 ++-- library/stdlib_arg.c | 5 ++++- library/utsname_uname.c | 4 ++-- 8 files changed, 27 insertions(+), 12 deletions(-) diff --git a/library/changes b/library/changes index cfb159c..1ca8427 100644 --- a/library/changes +++ b/library/changes @@ -1,5 +1,13 @@ c.lib 1.201 (21.9.2006) +- If defined, the local environment variable "DISABLE_COMMANDLINE_WILDCARD_EXPANSION" + will disable expansion of wildcard patterns passed on the command line. + Note that if the variable is not set then the global variable + '__expand_wildcard_args' will provide the defaults for the switch that + controls whether the wildcard expansion takes place. And after the + environment variable has been checked, the '__expand_wildcard_args_check' + function pointer can still be used to override the switch. + - fstat() now works with "NIL:" and "/dev/null", respectively. Not that it returns much useful information, though. diff --git a/library/include/dos.h b/library/include/dos.h index bf83f08..0482d96 100644 --- a/library/include/dos.h +++ b/library/include/dos.h @@ -1,5 +1,5 @@ /* - * $Id: dos.h,v 1.25 2006-09-15 06:58:17 obarthel Exp $ + * $Id: dos.h,v 1.26 2006-09-22 07:54:25 obarthel Exp $ * * :ts=4 * @@ -484,6 +484,10 @@ extern BOOL __thread_safe_errno_h_errno; * be available at that time, i.e. you cannot just set it differently in * your code lateron because by that time the startup code will have already * checked it. + * + * Note that the startup code will disable wildcard expansion if the local + * shell environment variable "DISABLE_COMMANDLINE_WILDCARD_EXPANSION" + * is set. */ extern BOOL __expand_wildcard_args; diff --git a/library/math_atan2.c b/library/math_atan2.c index a7f6379..eea15ee 100644 --- a/library/math_atan2.c +++ b/library/math_atan2.c @@ -1,5 +1,5 @@ /* - * $Id: math_atan2.c,v 1.8 2006-01-08 12:04:23 obarthel Exp $ + * $Id: math_atan2.c,v 1.9 2006-09-22 07:54:24 obarthel Exp $ * * :ts=4 * @@ -225,7 +225,7 @@ __atan2(double y,double x) if( ((ix|((lx|-lx)>>31))>0x7ff00000) || ((iy|((ly|-ly)>>31))>0x7ff00000) ) /* x or y is NaN */ return x+y; - if((hx-0x3ff00000|lx)==0) + if(((hx-0x3ff00000)|lx)==0) return atan(y); /* x=1.0 */ m = ((hy>>31)&1)|((hx>>30)&2); /* 2*sign(x)+sign(y) */ diff --git a/library/math_exp.c b/library/math_exp.c index 62c4c92..f9580b4 100644 --- a/library/math_exp.c +++ b/library/math_exp.c @@ -1,5 +1,5 @@ /* - * $Id: math_exp.c,v 1.6 2006-01-08 12:04:23 obarthel Exp $ + * $Id: math_exp.c,v 1.7 2006-09-22 07:54:24 obarthel Exp $ * * :ts=4 * @@ -158,7 +158,7 @@ P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */ INLINE STATIC double __exp(double x) { - double y,hi,lo,c,t; + double y,hi=0,lo=0,c,t; int k,xsb; unsigned int hx; diff --git a/library/math_kernel_expm1.c b/library/math_kernel_expm1.c index 7d9dfa3..57ce201 100644 --- a/library/math_kernel_expm1.c +++ b/library/math_kernel_expm1.c @@ -1,5 +1,5 @@ /* - * $Id: math_kernel_expm1.c,v 1.3 2006-01-08 12:04:23 obarthel Exp $ + * $Id: math_kernel_expm1.c,v 1.4 2006-09-22 07:54:24 obarthel Exp $ * * :ts=4 * @@ -67,7 +67,7 @@ Q5 = -2.01099218183624371326e-07; /* BE8AFDB7 6E09C32D */ double __expm1(double x) { - double y,hi,lo,c,t,e,hxs,hfx,r1; + double y,hi,lo,c=0,t,e,hxs,hfx,r1; int k,xsb; unsigned int hx; diff --git a/library/math_sqrt.c b/library/math_sqrt.c index 10298f0..1235e9e 100644 --- a/library/math_sqrt.c +++ b/library/math_sqrt.c @@ -1,5 +1,5 @@ /* - * $Id: math_sqrt.c,v 1.8 2006-01-08 12:04:24 obarthel Exp $ + * $Id: math_sqrt.c,v 1.9 2006-09-22 07:54:24 obarthel Exp $ * * :ts=4 * @@ -143,7 +143,7 @@ INLINE STATIC double __sqrt(double x) { double z; - int sign = (int)0x80000000; + unsigned int sign = (unsigned int)0x80000000; unsigned int r,t1,s1,ix1,q1; int ix0,s0,q,m,t,i; diff --git a/library/stdlib_arg.c b/library/stdlib_arg.c index b774244..3aa1ff3 100644 --- a/library/stdlib_arg.c +++ b/library/stdlib_arg.c @@ -1,5 +1,5 @@ /* - * $Id: stdlib_arg.c,v 1.12 2006-09-15 06:58:16 obarthel Exp $ + * $Id: stdlib_arg.c,v 1.13 2006-09-22 07:54:25 obarthel Exp $ * * :ts=4 * @@ -135,6 +135,9 @@ ARG_CONSTRUCTOR(arg_init) { expand_wildcard_args = __expand_wildcard_args; + if(FindVar("DISABLE_COMMANDLINE_WILDCARD_EXPANSION",LV_VAR) != NULL) + expand_wildcard_args = FALSE; + if(__expand_wildcard_args_check != NULL) expand_wildcard_args = (*__expand_wildcard_args_check)(); } diff --git a/library/utsname_uname.c b/library/utsname_uname.c index bf297d6..2b6919f 100644 --- a/library/utsname_uname.c +++ b/library/utsname_uname.c @@ -1,5 +1,5 @@ /* - * $Id: utsname_uname.c,v 1.5 2006-01-08 12:04:27 obarthel Exp $ + * $Id: utsname_uname.c,v 1.6 2006-09-22 07:54:25 obarthel Exp $ * * :ts=4 * @@ -68,7 +68,7 @@ uname(struct utsname *info) { struct Library * VersionBase; int Version,Revision; - char * version_string; + const char * version_string; int result = ERROR; ENTER();