Incorrect opening when file name starts with dash ('-')

*** Please report new bugs here! ***

Moderators: XnTriq, helmut, xnview, Dreamer

Post Reply
val
Posts: 6
Joined: Thu Dec 27, 2007 5:09 am

Incorrect opening when file name starts with dash ('-')

Post by val »

XnViewMP correctly opens and displays pictures in the viewer (e. g.

Code: Select all

C:\soft\XnViewMP\xnviewmp.exe "imxyM_lt3DU.jpg"
)

Sadly if file name starts with dash (e. g.

Code: Select all

C:\soft\XnViewMP\xnviewmp.exe "-BUF883DY90.jpg"
) XnViewMP doesn't display the image, but opens its own file browser (not even with the current path).

I think this is happening because its command line parser thinks this is a command line option, correctness fails and XnViewMP falls through to some safe option.

Maybe XnViewMP in such cases (where command line parsing fails) should check afterwards if such file exists and opens it.
Another option - additional command line parameter that means "the following aren't options, but arguments" (like "--" in Linux). Or command line parameter "open the file in the viewer".
User avatar
xnview
Author of XnView
Posts: 43328
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Incorrect opening when file name starts with dash ('-')

Post by xnview »

a workaround is to use ".\-file.jpg"
Pierre.
Post Reply