diff --git a/src/cpp.c b/src/cpp.c index 33b32a2d15523f490ab54be8b00f9eb6f0e5b3eb..670369a26912b2438c7c022732176e16940e738a 100644 --- a/src/cpp.c +++ b/src/cpp.c @@ -5,7 +5,7 @@ \*/ /* - * $Id: cpp.c,v 1.52 1999/08/17 19:00:27 grubba Exp $ + * $Id: cpp.c,v 1.53 1999/08/25 05:05:55 hubbe Exp $ */ #include "global.h" #include "language.h" @@ -953,26 +953,37 @@ static void check_constant(struct cpp *this, if(!isidchar(INDEX_PCHARP(data, dlen))) break; - s = begin_wide_shared_string(dlen, data.shift); - MEMCPY(s->str, data.ptr, dlen<<data.shift); - push_string(end_shared_string(s)); + if(dlen) + { + s = begin_wide_shared_string(dlen, data.shift); + MEMCPY(s->str, data.ptr, dlen<<data.shift); + push_string(end_shared_string(s)); #ifdef PIKE_DEBUG - s = NULL; + s = NULL; #endif /* PIKE_DEBUG */ - if((sv=low_mapping_string_lookup(get_builtin_constants(), - sp[-1].u.string))) - { - pop_stack(); - push_svalue(sv); - res=1; - }else if(get_master()) { + if((sv=low_mapping_string_lookup(get_builtin_constants(), + sp[-1].u.string))) + { + pop_stack(); + push_svalue(sv); + res=1; + }else if(get_master()) { + ref_push_string(this->current_file); + SAFE_APPLY_MASTER("resolv",2); + + res=(throw_value.type!=T_STRING) && + (!(IS_ZERO(sp-1) && sp[-1].subtype == NUMBER_UNDEFINED)); + }else{ + res=0; + } + }else{ + /* Handle contant(.foo) */ + push_text("."); ref_push_string(this->current_file); - SAFE_APPLY_MASTER("resolv",2); - + SAFE_APPLY_MASTER("handle_import",2); + res=(throw_value.type!=T_STRING) && (!(IS_ZERO(sp-1) && sp[-1].subtype == NUMBER_UNDEFINED)); - }else{ - res=0; } while(1)