Macaulay2 / M2

The primary source code repository for Macaulay2, a system for computing in commutative algebra, algebraic geometry and related fields.
https://macaulay2.com
330 stars 226 forks source link

Fix baseFilename w/ empty string or string containing only /'s #3332

Closed d-torrance closed 2 days ago

d-torrance commented 6 days ago

Previously, we got an index error since we were calling last on a list returned by separate, which was empty in these cases.

We match the behavior of the basename command line utility for these cases. The POSIX standard says that "" and "//" are implementation defined, so we match the Linux version in these cases ("" and "/", respectively). As per the POSIX standard, a string containing only slashes results in "/".

This fixes an old findFiles bug, so we remove the corresponding file in the bugs directory.