lyx2lyx error not as informative when opening newer file

Enrico Forestieri forenr at lyx.org
Sun Dec 11 11:13:28 UTC 2022


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.

-- 
Enrico


More information about the lyx-devel mailing list