read-line cuts off #\newline but leaves #\return at the end of the string returned

Bug #1666684 reported by Roland Salz
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
SBCL
New
Undecided
Unassigned

Bug Description

The CAS Maxima is a program written in Lisp that is heavily used both in Unix and Windows environments. Even though Maxima is set up to work for a number of different Lisp systems, SBCL is the favorite Lisp used (because it is fast). The Maxima build process is rather flexible, too, it can be done on Unix or on Windows, or even by cross compiling on unix for windows, be it locally or remotely. The Lisp code has to work in all situations.

It is a severe problem for us that on windows a read-line cuts off the #\newline character but leaves the #\return at the end of the string returned. Our code, written originally for unix environments only, does not expect this.

This is in the strict sense not non-conforming to ANSI CL, but it is also not what the creators of ANSI CL would have wanted. Recently we discovered this to be the reason for a number of bugs that we had not been able to resolve for a long time.

What we have to do now as a work around is to string-trim the #\return manually after a read-line, so that it does not create bugs under Windows situations. But Maxima's code has grown for over 50 years, by hundreds of programmers (Maxima was created in the late 60s already and has been improved ever since). It is not a small program. The exact locations of such read-line bugs are hard to find, there are numerous interdependencies, that hardly anyone has the overview of.

We urgently ask for a solution to this. Is it possible for you to cut off the #\return, too, in windows environments automatically? This would be the best solution. Otherwise a mechanism for specifying eol-handling by the user would be needed.

Thanks for any help.
Best regards,
Roland

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.