The shadow file name should have spot where the shadow
file number will be set. This is either the character preceding
the last period after the last slash or the last character if there
is no period.
For example:
0100 3390 disks/linux1.dsk sf=shadows/linux1_*.dsk
The existing code however does not behave this way. Instead, it places the shadow file number immediately before the first period found in the shadow file name, not the last period. For example, if I use the following configuration file statement:
This is because the asterisk ('') character is an illegal file name character. The asterisk in the preceding shadow file name is where the shadow file number should have been placed, according to the documentation. As you can see, however, it instead replaced the character immediately before the first period, yielding an illegal file name of "1.b.cShadow.cckd".
If I instead replace the periods with underscores however (leaving the period and file extension intact):
Looking at the code, it appears the bug is being caused by ckddasd.c (and fbadasd.c) mistakenly doing a "strchr" to locate the first period instead of doing a "strrchr" to locate the last period.
According to the documentation:
The existing code however does not behave this way. Instead, it places the shadow file number immediately before the first period found in the shadow file name, not the last period. For example, if I use the following configuration file statement:
I get an error and my dasd image is not opened:
This is because the asterisk ('') character is an illegal file name character. The asterisk in the preceding shadow file name is where the shadow file number should have been placed, according to the documentation. As you can see, however, it instead replaced the character immediately before the first period, yielding an illegal file name of "1.b.cShadow.cckd".
If I instead replace the periods with underscores however (leaving the period and file extension intact):
Then it works fine:
Looking at the code, it appears the bug is being caused by ckddasd.c (and fbadasd.c) mistakenly doing a "strchr" to locate the first period instead of doing a "strrchr" to locate the last period.
(Note: this is not simply a documentation bug.)