comparison src/variables.cc @ 2790:ecc1a12678de

[project @ 1997-03-05 02:47:54 by jwe]
author jwe
date Wed, 05 Mar 1997 02:47:55 +0000
parents 0c5e671499ed
children 74bc1ede3c3d
comparison
equal deleted inserted replaced
2789:e68dcf8ffd33 2790:ecc1a12678de
329 error ("exist: expecting string argument"); 329 error ("exist: expecting string argument");
330 return retval; 330 return retval;
331 } 331 }
332 332
333 string struct_elts; 333 string struct_elts;
334 string symbol_name = name;
334 335
335 size_t pos = name.find ('.'); 336 size_t pos = name.find ('.');
336 337
337 if (pos != NPOS) 338 if (pos != NPOS && pos > 0)
338 { 339 {
339 struct_elts = name.substr (pos+1); 340 struct_elts = name.substr (pos+1);
340 name = name.substr (0, pos); 341 symbol_name = name.substr (0, pos);
341 } 342 }
342 343
343 symbol_record *sr = curr_sym_tab->lookup (name, 0, 0); 344 symbol_record *sr = curr_sym_tab->lookup (symbol_name, 0, 0);
344 if (! sr) 345 if (! sr)
345 sr = global_sym_tab->lookup (name, 0, 0); 346 sr = global_sym_tab->lookup (symbol_name, 0, 0);
346 347
347 retval = 0.0; 348 retval = 0.0;
348 349
349 if (sr && sr->is_variable () && sr->is_defined ()) 350 if (sr && sr->is_variable () && sr->is_defined ())
350 { 351 {