[GH-ISSUE #135] File name with one letter #109

Closed
opened 2026-05-05 11:41:49 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @Nipou on GitHub (Nov 2, 2017).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/135

Originally assigned to: @jmcnamara on GitHub.

In Microsoft Visual Studio Professional 2015
Version 14.0.25431.01 Update 3
Visual C++ 2015 00325-60001-65048-AA435

  string filename = "test.xlsx";
  lxw_workbook  *workbook = workbook_new(filename.c_str());
  addToWorkbook(workbook);
  workbook_close(workbook);

Produce the valid file 't'.
This code do the same :

  char name[10] = { 't','e','s','t','.','x','l','s','x','\0' };
  lxw_workbook  *workbook = workbook_new(&name[0]);
Originally created by @Nipou on GitHub (Nov 2, 2017). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/135 Originally assigned to: @jmcnamara on GitHub. In Microsoft Visual Studio Professional 2015 Version 14.0.25431.01 Update 3 Visual C++ 2015 00325-60001-65048-AA435 string filename = "test.xlsx"; lxw_workbook *workbook = workbook_new(filename.c_str()); addToWorkbook(workbook); workbook_close(workbook); Produce the valid file 't'. This code do the same : char name[10] = { 't','e','s','t','.','x','l','s','x','\0' }; lxw_workbook *workbook = workbook_new(&name[0]);
gitea-mirror 2026-05-05 11:41:49 -06:00
Author
Owner

@jmcnamara commented on GitHub (Nov 2, 2017):

There is #define code to avoid that issue with MSVC: 18c8cb6dd2/src/packager.c (L33)

Your compiler should pick that up.

<!-- gh-comment-id:341582371 --> @jmcnamara commented on GitHub (Nov 2, 2017): There is #define code to avoid that issue with MSVC: https://github.com/jmcnamara/libxlsxwriter/blob/18c8cb6dd276bdf6da1527ad65b541539dc4e727/src/packager.c#L33 Your compiler should pick that up.
Author
Owner

@Nipou commented on GitHub (Nov 3, 2017):

Yes, the function _open_zipfile_win32(const char *filename) is compiled and used.

<!-- gh-comment-id:341707385 --> @Nipou commented on GitHub (Nov 3, 2017): Yes, the function _open_zipfile_win32(const char *filename) is compiled and used.
Author
Owner

@jmcnamara commented on GitHub (Nov 3, 2017):

Can you check out and compile this project using the instructions and let me know if it works for you: https://github.com/jmcnamara/MSVCLibXlsxWriter

<!-- gh-comment-id:341709458 --> @jmcnamara commented on GitHub (Nov 3, 2017): Can you check out and compile this project using the instructions and let me know if it works for you: https://github.com/jmcnamara/MSVCLibXlsxWriter
Author
Owner

@Nipou commented on GitHub (Nov 3, 2017):

Sorry but I workaround. No time to spend.

   wxCopyFile("x", filename);
   wxRemoveFile("x");

Otherwise the library work very fine.

Thanks you

<!-- gh-comment-id:341756747 --> @Nipou commented on GitHub (Nov 3, 2017): Sorry but I workaround. No time to spend. wxCopyFile("x", filename); wxRemoveFile("x"); Otherwise the library work very fine. Thanks you
Author
Owner

@jmcnamara commented on GitHub (Apr 27, 2018):

This issue should now be fixed on the master branch.

<!-- gh-comment-id:385062498 --> @jmcnamara commented on GitHub (Apr 27, 2018): This issue should now be fixed on the master branch.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/libxlsxwriter#109
No description provided.