[Z88dk-users] Bug report about "gets" for ZX81

Bridge to the z88dk-users mailing list
Post Reply
Well known member
Posts: 343
Joined: Thu Jul 26, 2007 9:06 am

[Z88dk-users] Bug report about "gets" for ZX81

Post by siggi »

I wanted to report an error and were forwarded to GITHUB to create it there.
But I need to create an account there to enter there a new error report.
I want to share the error information, but I don't want to share additional personal information neither with GITHUB nor with the data sink (we have in German the less kinds words "Datenkrake" or "Datenfresser", but I don't know the English equivalent) Microsoft.
So I post the error report here.

I tried to compile my old USB filemanager using the current nightly build. But now the function "gets()" fails at ZX81.
This is part of the code to save a file on USB stick

Code: Select all

                  if (!*name)
printk("name= ");
if (*name)
This code asks for a name, if it is not given. Then it reads it using gets(). If the name is then "" (empty), the SAVE command is aborted.

The old compiler dated 15/Dec/2015 gives that behaviour of gets:
a cursor "_" (a ZX81 graphic symbol) is written to screen. If a character is entered, it is inserted before the cursor, which moves right.
If I use backspace, the char before the cursor is deleted and the cursor moves left. If I have deleted all chars and press return, an empty string is in name and the SAVE command is aborted. That is the expected behaviour.

Now the buggy behaviour is:
a cursor 'E' is written to screen. If a character is entered, the cursor is overwritten and never occurs again. When I delete all entered characters to get an empty name string, the string "L" is stored in name. Thus the command is not aborted and a file "L.P" is stored on USB stick.


Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Post Reply