This appears to be an issue with the path slashes. I have interchanged the 
slashes in line 725 and 727 of textual.cc

from this..

725    string::size_type pos = pathstr.rfind('/');
726    if (pos == string::npos)
727      pos = pathstr.rfind('\\');

to..

725    string::size_type pos = pathstr.rfind('\\');
726    if (pos == string::npos)
727      pos = pathstr.rfind('/');

In Windows, ledger finds the drive path as D:/
Since the drive slash is wrong there, it finds the wrong root folder. With 
the above change, priority is given to the '\' slash.
I have tested the updated code on both Windows and Linux. It works as 
expected on both.

On Monday, August 31, 2015 at 10:10:30 PM UTC+5, John Wiegley wrote:
>
> >>>>> Maisam Musthafa <[email protected] <javascript:>> writes: 
>
> >> include 2014.ldg 
> >> include 2015.ldg 
>
> >     My experience in Linux is the files are included relative to the 
> >     current working directory that you are in when you run ledger. 
>
> Ledger should search first in the directory of the file in which the 
> include 
> was found.  If not, this is a bug. 
>
> John 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to