Bill, many thanks for the pointer to the library manager. I inherited the setup from a student and did not realize the library was available through the library manager of the IDE ...
I downloaded the newest version (1.1.2) and the source (.cpp) contains the code snippet of DonPedro's fix.
Seeing the whole context in the code, I get the feeling that the compiler instructions are meant to only apply the fix for certain Arduino projects ...
It isn't a fix that that is related to any sort of project. It is that IDE 1.0 and beyond uses different APIs than pre 1.0 and the code in this library was not properly using the IDE 1.0 interface.
The library has to check if it is being used on pre 1.0 or 1.0 and beyond and when used in 1.0 and beyond the code was wrong.
The issue goes back to a major problem the Arduino team created when they released Arduino 1.0
After the final release candidate, but before they create the official 1.0 release The arduino team made some changes that broke 100% of ALL the existing 3rd party libraries.
Think of that for a moment. They consciously decided to break 100% of ALL the existing Arduino 3rd party libraries and to do that in between the final 1.0 release candidate and the final 1.0 release.
No beta, no release candidate for testing. Just BAM. Change the code and break all arduino 3rd party library. What was particularly frustrating was that were ways to provide backward compatibility for almost all the changes to ensure that the pre 1.0x libraries would continue to work. This is not the way s/w release are normally handled as you normally don't make such a major change between a final release candidate and the final release.
There was much controversy over this decision and it has only been recently that some members of the arduino team finally realized what pain they created for the community.
We are still fighting pre 1.x vs post 1.0 library issues to this day even many years after the 1.0 release.
We almost had another Arduino library total meltdown again when switching from the 1.0 library format to the newer 1.5x library format (which is what the IDE is using today).
Luckily a few of us were able to convince the Arduino team to allow the pre 1.5x libraries to work in the post 1.5x IDEs. Otherwise, 100% of ALL the existing 3rd party libraries would have broken and had to be updated to work with the post 1.5x IDEs.
I will say that it took much lobbying to get this to happen, and several of the founding Arduino team members were against pre 1.5x library compatibility.
Luckily, Cristian made the sane decision that backward compatibility is very important and prevented a repeat of the chaos that happened when 1.0 was released.
One of the changes (there were several) the Arduino team made when they went to 1.0 that broke everything was to change how write() worked. Originally it was a void function, the new version returns an integer count.
In this case the lcd library returned the wrong count, but until the newer versions of the IDE, the code in the Print class ignored the return value. As soon as it started looking at the return value, this lcd library broke.
The fixe to this lcd library actually was done in just a matter of days of the issue being discovered. (several months ago)
However, the library was not properly tagged in the git repo so even though the source code for the fix was in the code in the git repo, the library manager didn't see there was a new version available since it was not tagged and tags are how library managers "sees" library versions/updates.
I contacted the maintainer of the library about a week or so ago and had him tag the library so the updated library would show up in the library manager.
There are two seemingly identical entries for the library in the library manager.
The first one failed to install for me (I think it said "CRC corrupted"?), the second installed just fine.
I have seen that as well. I'm not sure what is going on here. I think it is actually a bug in the library manager.
Both libraries point to the same git repo, so there really only is one library and the library manager only allows a single library for any given name. It shouldn't be possible to have two libraries in the library manager with the same name.
This particular library has a different author than maintainer and perhaps that is somehow confusing the library manager into thinking it is two different libraries and creating some sort of issue.
(just a guess)
I may go bug it so it can be resolved.
--- bill