www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/15/12:02:23

From: Martin Stromberg <Martin DOT Stromberg AT lu DOT erisoft DOT se>
Message-Id: <199803151700.SAA03133@propus.lu.erisoft.se>
Subject: Re: Where to get the latest sources for djtar
To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
Date: Sun, 15 Mar 1998 18:00:44 +0100 (MET)
Cc: djgpp AT delorie DOT com (DJGPP)
In-Reply-To: <Pine.SUN.3.91.980315153908.9861I-100000@is> from "Eli Zaretskii" at Mar 15, 98 03:39:31 pm
MIME-Version: 1.0

Here my patch. It corrects the stack from being overwritten, when the
disk is full or when the directory nesting is to deep, when the user
gives first one directory name and then another which is longer than
the first.

*** djlib/src/utils/djtar/djtar.org     Thu Jan  1 16:35:50 1998
--- djlib/src/utils/djtar/djtar.c       Fri Mar 13 23:23:06 1998
***************
*** 234,240 ****
--- 234,246 ----
          break;
        r = mkdir (n, 0777);
        if (r)
+       {
+         if(errno == ENOENT)
+         {
+           Fatal("Unable to create directory");
+         }
          r = change(n, "Unable to create directory", 1);
+       }
        } while (r);
        *sl = save;
      }
***************
*** 446,451 ****
--- 452,461 ----
      {
        status = change(dirname, "Duplicate directory name", 2);
        continue;
+     }
+     if (status && (errno==ENOENT))
+     {
+       Fatal("Unable to create directory");
      }
      if (status)
        status = change(dirname, "Unable to create directory", 1);

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019