X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmodify-vars.c;h=20898e0a8c525360a88c49ef4556ebfdd2c366af;hb=df034e315b329d26fd6309d19a3f6e53b18e5e3a;hp=aab05c6e0e029083241123c0cfa3e19e5c82cc89;hpb=205ac3afa4c2b19c85819d8695abf3975bb11807;p=pspp diff --git a/src/modify-vars.c b/src/modify-vars.c index aab05c6e0e..20898e0a8c 100644 --- a/src/modify-vars.c +++ b/src/modify-vars.c @@ -14,8 +14,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ #include #include @@ -24,6 +24,7 @@ #include "alloc.h" #include "bitvector.h" #include "command.h" +#include "dictionary.h" #include "error.h" #include "hash.h" #include "lexer.h" @@ -32,6 +33,9 @@ #include "var.h" #include "vfm.h" +#include "gettext.h" +#define _(msgid) gettext (msgid) + /* FIXME: should change weighting variable, etc. */ /* These control the ordering produced by compare_variables_given_ordering(). */ @@ -347,7 +351,7 @@ compare_variables_given_ordering (const void *a_, const void *b_, if (ordering->positional) result = a->index < b->index ? -1 : a->index > b->index; else - result = strcmp (a->name, b->name); + result = strcasecmp (a->name, b->name); if (!ordering->forward) result = -result; return result; @@ -357,7 +361,7 @@ compare_variables_given_ordering (const void *a_, const void *b_, struct var_renaming { struct variable *var; - char new_name[9]; + char new_name[LONG_NAME_LEN + 1]; }; /* A algo_compare_func that compares new_name members in struct @@ -369,7 +373,7 @@ compare_var_renaming_by_new_name (const void *a_, const void *b_, const struct var_renaming *a = a_; const struct var_renaming *b = b_; - return strcmp (a->new_name, b->new_name); + return strcasecmp (a->new_name, b->new_name); } /* Returns true if performing VM on dictionary D would not cause @@ -386,7 +390,8 @@ validate_var_modification (const struct dictionary *d, struct variable **all_vars; struct variable **keep_vars; struct variable **drop_vars; - size_t all_cnt, keep_cnt, drop_cnt; + size_t keep_cnt, drop_cnt; + int all_cnt; struct var_renaming *var_renaming; int valid;