Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot skip columns for XPT files #153

Closed
ofajardo opened this issue Oct 16, 2018 · 3 comments
Closed

cannot skip columns for XPT files #153

ofajardo opened this issue Oct 16, 2018 · 3 comments
Labels

Comments

@ofajardo
Copy link

ofajardo commented Oct 16, 2018

When skipping columns (returning READSTAT_HANDLER_SKIP_VARIABLE from my variable handler function for certain variables) and then recovering the index after skipping with readstat_variable_get_index_after_skipping from my value handler function, the index after skipping does not look right in the case of XPT files.
It seems to me that in the function xport_process_row in readstat_xport_read.c this case is not handled.
I replaced lines 565-568 by this (copied from readstat_por_read.c line 629), and it seems to solve the issue:

if (ctx->handle.value && !ctx->variables[i]->skip) {
            if (ctx->handle.value(ctx->parsed_row_count, variable, value, ctx->user_ctx) != READSTAT_HANDLER_OK) {
                retval = READSTAT_ERROR_USER_ABORT;
                goto cleanup;
            }
        }

Any chance to get this corrected into the code?
thanks!

@evanmiller
Copy link
Contributor

Hi, can you send along a pull request with your recommended change? Thanks

@ofajardo
Copy link
Author

absolutely!

@ofajardo
Copy link
Author

Solved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants