stephenc / java-iso-tools

A fork of JIIC hosted on github
http://github.com/stephenc/java-iso-tools/wiki
GNU Lesser General Public License v2.1
78 stars 45 forks source link

Two possible bugs in iso9660-writer #3

Open davideraccagni opened 13 years ago

davideraccagni commented 13 years ago

Hello, making some tests with iso9660-writer, I discovered that:

  1. ISO9660File(ISO9660File file) constructor didn't copy some properties. In order to solve the problem, I added:

    this.enforce8plus3 = file.enforce8plus3;
    this.enforceDotDelimiter = file.enforceDotDelimiter;
    this.id = file.getID();
  2. method apply(ISO9660File file) of JolietNamingConventions class rise an exception if the file name is 60 characters long (excluded the extension). I fixed the problem in the following way:

    if (filename.length() + extension.length() + (file.getVersion() + "").length() + 2 > 64) {
       if (filename.length() >= extension.length()) {
           // Shorten filename
           filename = filename.substring(0, 64 - 2 - (file.getVersion() + "").length() - extension.length());
       } else {
           // Shorten extension
           extension = extension.substring(0, 64 - 2 - (file.getVersion() + "").length() - filename.length());
       }
    }

Regards, Davide Raccagni

barryoneill commented 10 years ago

I've been hit by issue #2 here as well (on a filename.length() = 59)

MaggiWuerze commented 7 years ago

still persists... and it is even done right in method above -.-