Fixed getSuggestedFilename to base the length of the suggested

filename from the original filename.
This commit is contained in:
Robert Greene 2003-02-05 03:50:55 +00:00
parent 2e7e67eb54
commit eeb43618a6
2 changed files with 4 additions and 2 deletions

View File

@ -634,6 +634,7 @@ public class DosFormatDisk extends FormattedDisk {
* and trimmed (trailing whitespace may cause confusion).
*/
public String getSuggestedFilename(String filename) {
return filename.toUpperCase().substring(0, 30).trim();
int len = Math.min(filename.length(), 30);
return filename.toUpperCase().substring(0, len).trim();
}
}

View File

@ -413,6 +413,7 @@ public class RdosFormatDisk extends FormattedDisk {
* and trimmed (trailing whitespace may cause confusion).
*/
public String getSuggestedFilename(String filename) {
return filename.toUpperCase().substring(0, 24).trim();
int len = Math.min(filename.length(), 24);
return filename.toUpperCase().substring(0, len).trim();
}
}