home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / ZSYS / SIMTEL20 / ZCPR3 / ZCPR3DIR.BUG < prev    next >
Text File  |  2000-06-30  |  4KB  |  99 lines

  1. December 18, 1984
  2.  
  3. Resident command 'DIR' fix in ZCPR3 and SYSRCP.ASM
  4.  
  5. Greetings all -- I have stumbled (truly!) upon a distasteful, though not
  6. essentially serious bug in both ZCPR3.ASM and the SYSRCP.ASM segment. 
  7. Fortunately (more for me than for you) a fix is easy and works 100%.  In my
  8. immodesty I used my name as a label for the fix.  I hope that some soul,
  9. hopefully Richard Conn in the next update to ZCPR3 will correct the bug in his
  10. imminently elegant way and get rid of my fix in the process.
  11.  
  12. I am probably one of the few folks who likes the resident DIR command, but I
  13. surely wanted to limit the use of the DIR flags to those who know which
  14. characters I use to invoke the DIR only, DIR and SYS files both, and the SYS
  15. files only.  In the RELEASE version of ZCPR3 and SYSRCP.ASM, the (SYS and DIR)
  16. flag is tested for absolutely, but the (SYS only) flag is inappropriately
  17. tested for, and if not found, then the (SYS and DIR) flag is assumed to have
  18. been used, and the whole directory, SYS and DIR, is displayed.    Try it; if you
  19. type 'DIR *.* $' or any other character in place of the '$', the entire
  20. directory, including SYS files will be displayed.  I merely made the SYS only
  21. flag testing an absolute, and when it failed, then automatically reverted to
  22. the DIR only mode.  Section 5A from the SYSRCP.ASM file follows (the ZCPR3
  23. section 5A is almost the same, and the area for modification is identical, as
  24. is the fix....)
  25.  
  26. Bucky Carr, SYSOP, World Peace RCP/M, Denver, 303-320-4822, 300/1200, 24 hrs
  27.  
  28. By the way, my highest compliments to Richard Conn (and the rest of the public
  29. domain programming community) for their immeasurable contributions to society
  30. via computing.
  31.  
  32.  
  33. ;Section 5A
  34. ;Command: DIR
  35. ;Function:  To display a directory of the files on disk
  36. ;Forms:
  37. ;    DIR <afn>    Displays the DIR files
  38. ;    DIR <afn> S    Displays the SYS files
  39. ;    DIR <afn> A    Display both DIR and SYS files
  40. ;Notes:
  41. ;    The flag SYSFLG defines the letter used to display both DIR and
  42. ;        SYS files (A in the above Forms section)
  43. ;    The flag SOFLG defines the letter used to display only the SYS
  44. ;        files (S in the above Forms section)
  45. ;    The flag WIDE determines if the file names are spaced further
  46. ;        apart (WIDE=TRUE) for 80-col screens
  47. ;    The flag FENCE defines the character used to separate the file
  48. ;        names
  49. ;
  50.     IF    DIRON
  51. DIR:
  52. ;
  53. ; CHECK FOR WHEEL APPROVAL IF OPTION ENABLED
  54. ;
  55.     IF    WDIR
  56.     CALL    WHLTST
  57.     ENDIF        ;WHEEL APPROVAL
  58. ;
  59.     CALL    RETSAVE        ;SAVE RET ADDRESS AND SET STACK
  60.     LXI    H,FCB1+1    ;MAKE FCB WILD (ALL '?') IF NO FILENAME.TYP
  61.     MOV    A,M        ;GET FIRST CHAR OF FILENAME.TYP
  62.     CPI    ' '        ;IF <SP>, ALL WILD
  63.     CZ    FILLQ
  64.     LDA    FCB2+1        ;GET FIRST CHAR OF 2ND FILE NAME
  65.     MVI    B,80H        ;PREPARE FOR DIR-ONLY SELECTION
  66.     CPI    ' '        ;ANY FLAG?
  67.     JRZ    DIRPR        ;THERE IS NO FLAG, SO DIR ONLY
  68.     MVI    B,1        ;SET FOR BOTH DIR AND SYS FILES
  69.     CPI    SYSFLG        ;SYSTEM AND DIR FLAG SPECIFIER?
  70.     JRZ    DIRPR        ;GOT SYSTEM SPECIFIER
  71.     CPI    SOFLG        ;SYS ONLY?
  72. ;
  73. ; ---> the fix begins here <---
  74. ;
  75.     JRZ    BUCKY    ;it was the SYS only flag, exactly!
  76.     MVI    B,80H    ;NOT the SYS flag either, so default to DIR only
  77.     JR    DIRPR    ;and do the directory as requested.
  78. ;
  79. ; ---> commented out the next two lines of original code <---
  80. ;
  81. ;    JRNZ    DIRPR
  82. ;    DCR    B        ;B=0 FOR SYS FILES ONLY
  83. ;
  84. ; ---> added the 'SYS flag ok' routine here <---
  85. ;
  86. BUCKY:    MVI    B,0    ;as described below, if SYS only=true then reg B=0
  87.     JR    DIRPR    ;now go on with the dirpr routine.
  88. ;
  89. ; ---> that ends the fix <---
  90.  
  91.     ENDIF        ;DIRON
  92. ;
  93. ; DIRECTORY PRINT ROUTINE; ON ENTRY, B REG IS SET AS FOLLOWS:
  94. ;    0 FOR ONLY SYSTEM FILES, 80H FOR ONLY DIR FILES, 1 FOR BOTH
  95. ;
  96.     IF    DIRON OR ERAON OR LTON OR PROTON OR CPON OR RENON
  97. DIRPR:
  98.     MOV    A,B        ;GET SYSTST FLAG
  99.