syncthing: Globbing needs to take care of special file names (versioning, conflicts)

Wherever we build glob patterns based on existing file names we need to take care of the fact that they can contain things like [-] which gets interpreted as a broken character range.

Probably we need a well tested utility function to build these patterns, or use something other than globbing.

About this issue

  • Original URL
  • State: open
  • Created 11 years ago
  • Reactions: 6
  • Comments: 17 (15 by maintainers)

Most upvoted comments

Have been having this issue on some files also:

 2024-04-08 16:00:12: globbing: syntax error in pattern for Data/Scripts/retool/app/tests/goldens/features/Retool - Exclusions (-x) [-aAbBcdDefkmMopPruv]~[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9].dat

2024-04-08 16:02:12: globbing: syntax error in pattern for Data/Cache/DATs/No-Intro/Bally - Astrocade (Tapes) (Parent-Clone) (20220914-145554) (Retool 2024-04-08 10-38-45) (1) [-AbBcdefkmopPruv]~[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9].dat

2024-04-08 16:02:12: globbing: syntax error in pattern for Data/Cache/DATs/No-Intro/Commodore - Commodore 64 (Parent-Clone) (20240127-100749) (Retool 2024-04-08 10-36-39) (290) [-AbBcdefkmopPruv]~[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9].dat

2024-04-08 16:02:12: globbing: syntax error in pattern for Data/Cache/DATs/No-Intro/VTech - CreatiVision (Parent-Clone) (20230426-080718) (Retool 2024-04-08 10-39-59) (24) [-AbBcdefkmopPruv]~[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9].dat 

Glob package we are using has QuoteMeta specifically for this purpose