Pavel Sanda wrote:
> hi,
> 
> i have the following codes:
> 
> #1:
> case LFUN_VC_COMMAND: {
>       string path = cmd.getArg(1);
>       support::PathChanger p(FileName(path));
> 
> 
> #2:
> case LFUN_VC_COMMAND: {
>       string path = cmd.getArg(1);
>       support::PathChanger p(FileName(cmd.getArg(1));
> 
> 
> in the first case path is not changed, in the second case the path is changed.
> when i put lyxerr<<"blabla" into the constructor of pathchanger the message
> is showed only in the second case.
> 
> i hope i'm too much tired and missing something obvious because the compiler
> shouldn't "optimalize" this code (p is not used anywhere else in the block).

this way it works too:

case LFUN_VC_COMMAND: {
        string path = cmd.getArg(1);
        FileName pp(path);
        support::PathChanger p(pp);

pavel

Reply via email to