X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Flanguage%2Fexpressions%2Foperations.def;h=7bcc02da3189260294a8b19bec560fa1784dcc7b;hb=f6c6ee97c412e47eb1c7c30adc224e93b6c1586a;hp=d3a31a746011e5fb3b22574ee1a9d3daea9736cb;hpb=8d023f3691564159dfd300cc92f386b47186bf50;p=pspp diff --git a/src/language/expressions/operations.def b/src/language/expressions/operations.def index d3a31a7460..7bcc02da31 100644 --- a/src/language/expressions/operations.def +++ b/src/language/expressions/operations.def @@ -816,10 +816,10 @@ absorb_miss string function SUBSTR (string s, integer ofs) : empty_string); } -absorb_miss string function SUBSTR (string s, integer ofs, integer cnt) +absorb_miss string function SUBSTR (string s, integer ofs, integer len) { - return (ofs >= 1 && cnt >= 1 - ? ss_substr (s, ofs - 1, cnt) + return (ofs >= 1 && len >= 1 + ? ss_substr (s, ofs - 1, len) : empty_string); } @@ -1186,7 +1186,7 @@ absorb_miss no_opt operator VEC_ELEM_NUM (idx) if (var) { double d = case_num (c, var); - if (!var_is_num_missing (var, d, MV_USER)) + if (var_is_num_missing (var, d) != MV_USER) return d; } return SYSMIS; @@ -1227,7 +1227,7 @@ no_opt operator NUM_VAR () num_var v; { double d = case_num (c, v); - return !var_is_num_missing (v, d, MV_USER) ? d : SYSMIS; + return var_is_num_missing (v, d) ? SYSMIS : d; } no_opt string operator STR_VAR () @@ -1247,7 +1247,7 @@ no_opt perm_only function LAG (num_var v, pos_int n_before) if (c != NULL) { double x = case_num (c, v); - return !var_is_num_missing (v, x, MV_USER) ? x : SYSMIS; + return var_is_num_missing (v, x) ? SYSMIS : x; } else return SYSMIS; @@ -1260,7 +1260,7 @@ no_opt perm_only function LAG (num_var v) if (c != NULL) { double x = case_num (c, v); - return !var_is_num_missing (v, x, MV_USER) ? x : SYSMIS; + return var_is_num_missing (v, x) ? SYSMIS : x; } else return SYSMIS;