https://bugs.documentfoundation.org/show_bug.cgi?id=169176

            Bug ID: 169176
           Summary: BASIC: ScriptForge.IsFileName incorrectly rejects
                    filenames with commas (",") in Windows
           Product: LibreOffice
           Version: 25.8.2.2 release
          Hardware: All
                OS: Windows (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: [email protected]
          Reporter: [email protected]

Description:
I'm calling "FSO.GetBaseName(file)" after getting a list of files in a
directory using "filesList = FSO.Files" and "For Each file In filesList".  When
it gets to a file with a comma in the filename, it throws an error and exits
the code.

Steps to Reproduce:
In LibreOffice BASIC:
1. First, create a file with a comma (",") in the filename in directory
"DirName"
2. filesList = fs.Files(DirName, "*.*", IncludeSubfolders := False)
3. For Each file In filesList
4. TempName = fs.GetBaseName(file)
5. Next file

Actual Results:
LibreOffice BASIC will throw an error and exit the sub

Expected Results:
This shouldn't throw an error.  Commas are allowed in Windows filenames.


Reproducible: Always


User Profile Reset: No

Additional Info:
Tracked it down to a "Const" in the header of the SF_String module.  

I don't anything about Regular Expressions, but I imagine the comma needs to be
removed from:
  Const REGEXFILEWIN="^([A-Z]|[a-z]:)?[^<>:;,?""*|]+$"
making it:
  Const REGEXFILEWIN="^([A-Z]|[a-z]:)?[^<>:;?""*|]+$"

BTW:  I'm new to LibreOffice.  I'm also NOT a programmer (just insanely curious
about things), but I do use VBA once in a while.  

I would also like to write back filenames with commas, so is there any way I
can fix this myself, instead of waiting for some future release?  I mean, I can
see the problem, but I don't know how to access it to fix it!

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to