* strace.cc (main): Guard against previous setting of POSIXLY_CORRECT.

This commit is contained in:
Christopher Faylor 2004-02-11 00:29:42 +00:00
parent d832a288e5
commit 6dbfb93a04
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,7 @@
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.

View File

@ -903,13 +903,15 @@ main (int argc, char **argv)
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)
{
@ -994,6 +996,8 @@ character #%d.\n", optarg, (int) (endptr - optarg), endptr);
if (!ofile)
ofile = stdout;
if (!posixly_correct_set)
putenv ("POSIXLY_CORRECT=");
if (toggle)
dotoggle (pid);
else