Browse Source

correct handling of =<vector>

h_vogt 15 years ago
parent
commit
2bbacac418
  1. 3
      ChangeLog
  2. 15
      src/frontend/measure.c

3
ChangeLog

@ -1,3 +1,6 @@
2011-06-23 Holger Vogt
* measure.c: another try to obtain correct vector handling
2011-06-22 Robert Larice
* src/ngsconvert.c ,
* src/frontend/outitf.c ,

15
src/frontend/measure.c

@ -60,9 +60,12 @@ com_meas(wordlist *wl) {
return;
}
wl_count = wl;
/* check each wl entry, if it contain '=' and if the following token is
a vector. If yes, replace this vector by its value */
a single valued vector. If yes, replace this vector by its value.
Vectors may stem from other meas commands, or be generated elsewhere
within the .control .endc script. All other right hand side vectors are
treated in com_measure2.c. */
wl_index = wl;
while ( wl_index) {
@ -79,7 +82,9 @@ com_meas(wordlist *wl) {
if (err) {
/* check if vec_found is a valid vector */
d = vec_get(vec_found);
if (d) {
/* Only if we have a single valued vector, replacing
of the rigt hand side does make sense */
if (d && (d->v_length == 1) && (d->v_numdims == 1)) {
/* get its value */
sprintf(newval, "%e", d->v_realdata[0]);
tfree(vec_found);
@ -95,7 +100,9 @@ com_meas(wordlist *wl) {
INPevaluate( &vec_found, &err, 1 );
if (err) {
d = vec_get(vec_found);
if (d) {
/* Only if we have a single valued vector, replacing
of the rigt hand side does make sense */
if (d && (d->v_length == 1) && (d->v_numdims == 1)) {
*equal_ptr = '\0';
sprintf(newval, "%s=%e", token, d->v_realdata[0]);
// memory leak with first part of vec_found ?

Loading…
Cancel
Save