🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.bugs
Article #2311

unshar

#2311
From: Steve Peltz
Date: Fri, 05 Jan 1990 23:00
31 lines
1433 bytes
I never got any response on my question regarding a bug I found in unshar (my
patchlevel is 0, v2.0, I don't know if there are any patches out to the shar
package), so I guess I'll just post my fix and be done with it.

The problem is with specifying the -d (or -c) flag; it is supposed to create the
directory if it doesn't already exist, but if it does have to create it, it
fails to switch to it.


*** unshar.c.orig	Fri Nov  3 16:41:43 1989
--- unshar.c	Fri Nov  3 16:45:00 1989
***************
*** 334,340 ****
  	}
  
  	/* Got directory; try to go there.  Only make last component. */
! 	if (chdir(p) < 0 && mkdir(p, 0777) < 0 && chdir(p) < 0)
  	    Quit("Cannot chdir nor mkdir desired directory");
      }
      else
--- 334,340 ----
  	}
  
  	/* Got directory; try to go there.  Only make last component. */
! 	if (chdir(p) < 0 && (mkdir(p, 0777) < 0 || chdir(p) < 0))
  	    Quit("Cannot chdir nor mkdir desired directory");
      }
      else
--
Steve Peltz (almost) CFI-G
"Monticello traffic, Glider 949 landing 18, full stop"
Technical Details
Message-ID: <1990Jan5.230023.7949@ux1.cso.uiuc.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!ux1.cso.uiuc.edu!peltz

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!ux1.cso.uiuc.edu!peltz
From: peltz@cerl.uiuc.edu (Steve Peltz)
Newsgroups: comp.sources.bugs
Subject: unshar
Message-ID: <1990Jan5.230023.7949@ux1.cso.uiuc.edu>
Date: 5 Jan 90 23:00:23 GMT
Sender: news@ux1.cso.uiuc.edu (News)
Organization: UIUC Computer-based Education Research Lab
Lines: 31