taviso / 123elf

A native port of Lotus 1-2-3 to Linux.
1.17k stars 59 forks source link

Can't import file due to long filename #82

Closed sjuswede closed 2 years ago

sjuswede commented 2 years ago

To test the spreadsheet, I import some csv files of various kinds and do operations on them. I ran into a message when trying to import this file, and the file failed to import:

annual-enterprise-survey-2020-financial-year-provisional-csv.csv

The message I got at the bottom row is:

Name too long -- Press Help

When I rename the file to "annual.csv" it imports fine.

taviso commented 2 years ago

Confirmed - it seems like it's coming from lst_validate, I'll see if I can find where the limit is. Hopefully I can just rewrite it to accept any filename length.

taviso commented 2 years ago

I found the problem, file_validate checks if the strlen(name+ext) is longer than 14 characters from the import callback.

This seems like a logic error in the routine, they only intended to check if in DOS mode, but they accidentally also check in UNIX mode. I tried just removing that check in a debugger, and it works fine, imports the file no problem.

The solution is to reimplement this routine, it's a little bit complicated, but should be no problem. I'll work on it.

taviso commented 2 years ago

I have a hacky patch that resolves this bug, but it's big and complicated and I want to test it some more. I'm working on it!