raspberrypi / usbboot

Raspberry Pi USB booting code, moved from tools repository
Apache License 2.0
914 stars 231 forks source link

Fixed regex for sig file to replace only extension #111

Closed katiefaith closed 2 years ago

katiefaith commented 2 years ago

Previously, relative paths would confuse the file name generation regex. With this change, only the final '.' character is matched as the beginning of the file extension.

pelwell commented 2 years ago

You could go one better and exclude /s from the match, so as not to truncate a path with a . if the filename has no extension (although it's unlikely to arise in practice).

timg236 commented 2 years ago

Looks ok, not had chance to try this yet though

katiefaith commented 2 years ago

@pelwell good point. I updated the regex to [^./] to deal with that problem.

pelwell commented 2 years ago

Thanks!