Skip to content

Commit 1ef7d7f

Browse files
committed
slash is a valid filename character in CP/M. Map it to pound for Windows/Linux
1 parent 5dbdb6b commit 1ef7d7f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

ntvcm.cxx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -542,9 +542,12 @@ bool parse_FCB_Filename( FCB * pfcb, char * pcFilename )
542542

543543
for ( int i = 0; i < 8; i++ )
544544
{
545-
if ( ' ' == ( 0x7f & pfcb->f[ i ] ) )
545+
char c = ( 0x7f & pfcb->f[ i ] );
546+
if ( ' ' == c )
546547
break;
547-
*pcFilename++ = ( 0x7f & pfcb->f[ i ] );
548+
if ( '/' == c ) // slash is legal in CP/M and MT Pascal v3.0b uses it for P2/FLT.OVL. hack it to use #
549+
c = '#';
550+
*pcFilename++ = c;
548551
}
549552

550553
if ( ' ' != pfcb->t[0] )
@@ -553,9 +556,10 @@ bool parse_FCB_Filename( FCB * pfcb, char * pcFilename )
553556

554557
for ( int i = 0; i < 3; i++ )
555558
{
556-
if ( ' ' == ( 0x7f & pfcb->t[ i ] ) )
559+
char c = ( 0x7f & pfcb->t[ i ] );
560+
if ( ' ' == c )
557561
break;
558-
*pcFilename++ = ( 0x7f & pfcb->t[ i ] );
562+
*pcFilename++ = c;
559563
}
560564
}
561565

@@ -2232,7 +2236,6 @@ uint8_t x80_invoke_hook()
22322236
}
22332237
else
22342238
{
2235-
22362239
// return error 255 if the file doesn't exist.
22372240
// Pro Pascal Compiler v2.1 requires a 0 return code for a file that's not open but exists.
22382241

0 commit comments

Comments
 (0)