diff --git a/src/spss/readstat_sav_read.c b/src/spss/readstat_sav_read.c index d9e3b85..9db084d 100644 --- a/src/spss/readstat_sav_read.c +++ b/src/spss/readstat_sav_read.c @@ -317,6 +317,7 @@ static readstat_error_t parse_mr_line(const char *line, mr_set_t *result) { } static readstat_error_t sav_read_multiple_response_sets(size_t data_len, sav_ctx_t *ctx) { + return READSTAT_OK; // hatchet readstat_error_t retval = READSTAT_OK; char *mr_string = readstat_malloc(data_len + 1); @@ -1886,36 +1887,37 @@ readstat_error_t readstat_parse_sav(readstat_parser_t *parser, const char *path, ck_str_hash_insert(current_varinfo->name, current_varinfo, var_dict); } } - for (size_t i = 0; i < ctx->multiple_response_sets_length; i++) { - mr_set_t mr = ctx->mr_sets[i]; - for (size_t j = 0; j < mr.num_subvars; j++) { - char* sv_name_upper = malloc(strlen(mr.subvariables[j]) + 1); - if (sv_name_upper == NULL) { - retval = READSTAT_ERROR_MALLOC; - goto cleanup; - } - sv_name_upper[strlen(mr.subvariables[j])] = '\0'; - for (int c = 0; mr.subvariables[j][c] != '\0'; c++) { - sv_name_upper[c] = toupper((unsigned char) mr.subvariables[j][c]); - } - spss_varinfo_t *info = (spss_varinfo_t *)ck_str_hash_lookup(sv_name_upper, var_dict); - if (info) { - free(mr.subvariables[j]); - // mr.subvariables[j] = NULL; - if ((mr.subvariables[j] = readstat_malloc(strlen(info->longname) + 1)) == NULL) { - retval = READSTAT_ERROR_MALLOC; - goto cleanup; - } - // mr.subvariables[j][strlen(info->longname)] = '\0'; - strcpy(mr.subvariables[j], info->longname); - // mr.subvariables[j] = info->longname; - } - free(sv_name_upper); - // sv_name_upper = NULL; - } - } - if (var_dict) - ck_hash_table_free(var_dict); + // Hatchet !!! + // for (size_t i = 0; i < ctx->multiple_response_sets_length; i++) { + // mr_set_t mr = ctx->mr_sets[i]; + // for (size_t j = 0; j < mr.num_subvars; j++) { + // char* sv_name_upper = malloc(strlen(mr.subvariables[j]) + 1); + // if (sv_name_upper == NULL) { + // retval = READSTAT_ERROR_MALLOC; + // goto cleanup; + // } + // sv_name_upper[strlen(mr.subvariables[j])] = '\0'; + // for (int c = 0; mr.subvariables[j][c] != '\0'; c++) { + // sv_name_upper[c] = toupper((unsigned char) mr.subvariables[j][c]); + // } + // spss_varinfo_t *info = (spss_varinfo_t *)ck_str_hash_lookup(sv_name_upper, var_dict); + // if (info) { + // free(mr.subvariables[j]); + // // mr.subvariables[j] = NULL; + // if ((mr.subvariables[j] = readstat_malloc(strlen(info->longname) + 1)) == NULL) { + // retval = READSTAT_ERROR_MALLOC; + // goto cleanup; + // } + // // mr.subvariables[j][strlen(info->longname)] = '\0'; + // strcpy(mr.subvariables[j], info->longname); + // // mr.subvariables[j] = info->longname; + // } + // free(sv_name_upper); + // // sv_name_upper = NULL; + // } + // } + // if (var_dict) + // ck_hash_table_free(var_dict); metadata.multiple_response_sets_length = ctx->multiple_response_sets_length; metadata.mr_sets = ctx->mr_sets;