Skip to content

Commit 83b3efc

Browse files
committed
3.03 fixes to zips
git-svn-id: svn://192.168.1.10/public/Emutil@22898 0d6f1817-ed0e-0410-87c9-987e46238f29
1 parent 4c9a27e commit 83b3efc

10 files changed

+31
-14
lines changed

README

+3-1
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,12 @@ OPTIONS:
8989
-R recursive search inside DNP
9090
-A X approx matching min X% (slower)
9191
-V verbose
92-
-Q suppress parse errors
9392
-P X verbose on disks with X percent matches
9493
-C use memory cache of all comparison files
9594
-D X Recursive depth X
95+
-Q Suppress parsing errors
96+
-En X exclude files matching mask 'X' in path 'n'
97+
-N No sorting of source filenames
9698

9799
-----------------------------------------------------------------------------
98100
D64Mod

bin/CMDHDParser.jar

19 Bytes
Binary file not shown.

bin/D64Compare.jar

37 Bytes
Binary file not shown.

bin/D64Duplifind.jar

57 Bytes
Binary file not shown.

bin/D64FileMatcher.jar

233 Bytes
Binary file not shown.

bin/D64Mod.jar

569 Bytes
Binary file not shown.

bin/D64Search.jar

252 Bytes
Binary file not shown.

com/planet_ink/emutil/CBMDiskImage.java

+10-5
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ public synchronized byte[][][] getDiskBytes()
7979
this.cpmOs = CPMType.NOT;
8080
diskBytes = this.getDisk(F, imageFLen);
8181
length = imageFLen[0];
82+
if((type == ImageType.LNX)
83+
||(type == ImageType.T64))
84+
return diskBytes;
8285
if(length <= 0)
8386
length = 174848;
8487
// now, attempt to identify CP/M disks.
@@ -1435,8 +1438,6 @@ private List<FileInfo> getCPMFiles(final BitSet parseFlags)
14351438
public List<FileInfo> getFiles(final BitSet parseFlags)
14361439
{
14371440
final String imgName = F.getName();
1438-
final byte[][][] tsmap = this.getDiskBytes();
1439-
final int fileSize = getLength();
14401441
if(type == ImageType.T64)
14411442
return getTapeFiles(imgName,parseFlags);
14421443
else
@@ -1453,8 +1454,12 @@ public List<FileInfo> getFiles(final BitSet parseFlags)
14531454
}
14541455
}
14551456
else
1456-
if(cpmOs != CPMType.NOT)
1457-
return getCPMFiles(parseFlags);
1457+
{
1458+
if(cpmOs != CPMType.NOT)
1459+
return getCPMFiles(parseFlags);
1460+
}
1461+
final byte[][][] tsmap = this.getDiskBytes();
1462+
final int fileSize = getLength();
14581463
int t=type.dirHead.track;
14591464
final int maxT=type.numTracks( fileSize);
14601465
int s=type.dirHead.sector;
@@ -1590,7 +1595,7 @@ private static String getNextLYNXLineFromInputStream(final InputStream in, final
15901595
private List<FileInfo> getLNXDeepContents(final String imgName, final BitSet parseFlags) throws IOException
15911596
{
15921597
final List<FileInfo> list = new ArrayList<FileInfo>();
1593-
final byte[] data = getDiskBytes()[0][0];
1598+
final byte[] data = this.getFlatBytes();
15941599
final InputStream in = new ByteArrayInputStream(data);
15951600
final int[] bytesSoFar=new int[1];
15961601
int zeroes=0;

com/planet_ink/emutil/D64Base.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
*/
3333
public class D64Base
3434
{
35-
final static String EMUTIL_VERSION = "3.02";
35+
final static String EMUTIL_VERSION = "3.03";
3636
final static String EMUTIL_AUTHOR = "2024 Bo Zimmerman";
3737

3838
final static String spaces=" "

com/planet_ink/emutil/D64FileMatcher.java

+17-7
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,12 @@ public static List<File> getAllFiles(final File baseF, final Pattern P, final in
191191
public static List<FileInfo> getFileList(final File F, final boolean normalizeForCompare, final BitSet parseFlags)
192192
{
193193
List<FileInfo> fileData = null;
194-
final CBMDiskImage disk = new CBMDiskImage(F);
195-
if(disk.getType() != null)
194+
final CBMDiskImage.ImageType type = CBMDiskImage.getImageTypeAndGZipped(F);
195+
if(type != null)
196+
{
197+
final CBMDiskImage disk = new CBMDiskImage(F);
196198
fileData=disk.getFiles(parseFlags);
199+
}
197200
else
198201
if(getLooseImageTypeAndGZipped(F) != null)
199202
{
@@ -329,7 +332,7 @@ public static void main(final String[] args)
329332
System.out.println(" -C use memory cache of all comparison files");
330333
System.out.println(" -D X Recursive depth X");
331334
System.out.println(" -Q Suppress parsing errors");
332-
System.out.println(" -E X exclude files matching mask 'X'");
335+
System.out.println(" -En X exclude files matching mask 'X' in path 'n'");
333336
System.out.println(" -N No sorting of source filenames");
334337
System.out.println("");
335338
return;
@@ -342,7 +345,8 @@ public static void main(final String[] args)
342345
int deeper = -1;
343346
double pct=100.0;
344347
final BitSet parseFlags = new BitSet();
345-
final List<Pattern> excludeMasks = new LinkedList<Pattern>();
348+
final List<Pattern> excludeMasks1 = new LinkedList<Pattern>();
349+
final List<Pattern> excludeMasks2 = new LinkedList<Pattern>();
346350
for(int i=0;i<args.length;i++)
347351
{
348352
final int argLen = args[i].length();
@@ -377,8 +381,14 @@ public static void main(final String[] args)
377381
case 'E':
378382
if(i<args.length-1)
379383
{
384+
List<Pattern> which = excludeMasks2;
385+
if(c<args[i].length()-1)
386+
{
387+
if(args[i].charAt(c+1)=='1')
388+
which = excludeMasks1;
389+
}
380390
final Pattern P=Pattern.compile(args[i+1]);
381-
excludeMasks.add(P);
391+
which.add(P);
382392
i++;
383393
c=argLen;
384394
}
@@ -430,8 +440,8 @@ public static void main(final String[] args)
430440
List<File> F1s=new ArrayList<File>(1);
431441
List<File> F2s=new ArrayList<File>(1);
432442
try {
433-
F1s = getAllFiles(path,depth,excludeMasks);
434-
F2s = getAllFiles(expr,depth,excludeMasks);
443+
F1s = getAllFiles(path,depth,excludeMasks1);
444+
F2s = getAllFiles(expr,depth,excludeMasks2);
435445
} catch (final IOException e) {
436446
System.err.println(e.getMessage());
437447
System.exit(-1);

0 commit comments

Comments
 (0)