idlesign / torrentool

The tool to work with torrent files.
https://github.com/idlesign/torrentool
BSD 3-Clause "New" or "Revised" License
148 stars 30 forks source link

Fix path normalization #20

Open satyaog opened 2 years ago

satyaog commented 2 years ago

Prevent corrupting filename in the case the path is contained in a file name

Ex. from current working dir:

DIR/
DIR/prefix_DIR_suffix.ext

DIR/prefix_DIR_suffix.ext would previously be normalize to prefix__suffix.ext since DIR is found in filename. It should instead be normalized to prefix_DIR_suffix.ext.

idlesign commented 2 years ago

Thank you.  I'll try to review it in a few days.  I'd also want to ask you to add a test covering the issue.

idlesign commented 2 years ago

Will wait for a test.