2004-02-10 Christopher Faylor <cgf@redhat.com>
+ * strace.cc (main): Guard against previous setting of POSIXLY_CORRECT.
+
+2004-02-10 Christopher Faylor <cgf@redhat.com>
+
* strace.cc: Update copyrights.
* cygcheck.cc: Update copyrights.
pid_t pid = 0;
int opt;
int toggle = 0;
+ int posixly_correct_set = getenv ("POSIXLY_CORRECT") != NULL;
if (!(pgm = strrchr (*argv, '\\')) && !(pgm = strrchr (*argv, '/')))
pgm = *argv;
else
pgm++;
- (void) putenv("POSIXLY_CORRECT=1");
+ if (!posixly_correct_set)
+ (void) putenv("POSIXLY_CORRECT=1");
while ((opt = getopt_long (argc, argv, opts, longopts, NULL)) != EOF)
switch (opt)
{
if (!ofile)
ofile = stdout;
+ if (!posixly_correct_set)
+ putenv ("POSIXLY_CORRECT=");
if (toggle)
dotoggle (pid);
else