Strange behaviour of TApplication

Hi
I don’t understand the result of this short program:

#include <TApplication.h>
#include <iostream>
using namespace std;

int main(int argc, char** argv)
{
	system("pwd");
	string DirName=argv[1];
	TApplication theApp("App", &argc, argv);
	system("pwd");
}

if the first argument given is a existing directory (let say given_real_path )then the result of the program is :
current_path
given_real_path

if it is not a real path, the result is:
current_path
current_path

Why such a strange behaviour? how avoid the “cd” command in the first case?
Thanks for your help
Olivier
(I am using last root version, and either gcc 3.2.3 or gcc 3.4.4)

Hi Olivier,

see “root -h”. You could simply set argc=1 when initializing your TApplication object.

Axel.

Thanks very much. I didn’t know this feature of TApplication.
Olivier