lyx2lyx error not as informative when opening newer file

Richard Kimberly Heck rikiheck at gmail.com
Sun Dec 11 15:36:59 UTC 2022


On 12/11/22 06:13, Enrico Forestieri wrote:
> On Sun, Dec 11, 2022 at 12:06:34AM +0100, Yuriy Skalko wrote:
>>
>> And opening such file with non-existing version in LyX (master, 
>> Win10) gives that old message:
>>
>> <file> is from a newer version of LyX and the lyx2lyx script failed 
>> to convert it.
>
> Yes, this is true for the Windows version. The problem with posix 
> systems is that the return value of runCommand() is wrong. The man 
> page of pclose() says that
>
>     pclose returns -1 if the stream was not created by popen or if the 
>     application used wait or similar to steal the status; otherwise it 
>     returns the exit status of the child which can be interpreted in 
> the     same manner as a status obtained by waitpid
>
> So, the correct check for success is "WEXITSTATUS(pret) == 0" and not 
> "pret == -1". I am going to commit this fix.

Thanks, Enrico, that had me really puzzled.

Riki




More information about the lyx-devel mailing list