From: Martin Stromberg 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: from "Eli Zaretskii" at Mar 15, 98 03:39:31 pm MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk 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);