cd.c (afb033d5c4f01a464f57fe8e68d741246d9df492) | cd.c (e7a0b0244d302e1d3c199fd760f49c3dfdfd3ca9) |
---|---|
1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * | 1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * |
36 * $Id: cd.c,v 1.14 1997/02/22 13:58:22 peter Exp $ | 36 * $Id: cd.c,v 1.15 1997/04/28 03:06:32 steve Exp $ |
37 */ 38 39#ifndef lint 40static char const sccsid[] = "@(#)cd.c 8.2 (Berkeley) 5/4/95"; 41#endif /* not lint */ 42 43#include <sys/types.h> 44#include <sys/stat.h> --- 25 unchanged lines hidden (view full) --- 70STATIC void updatepwd __P((char *)); 71 72char *curdir = NULL; /* current working directory */ 73char *prevdir; /* previous working directory */ 74STATIC char *cdcomppath; 75 76int 77cdcmd(argc, argv) | 37 */ 38 39#ifndef lint 40static char const sccsid[] = "@(#)cd.c 8.2 (Berkeley) 5/4/95"; 41#endif /* not lint */ 42 43#include <sys/types.h> 44#include <sys/stat.h> --- 25 unchanged lines hidden (view full) --- 70STATIC void updatepwd __P((char *)); 71 72char *curdir = NULL; /* current working directory */ 73char *prevdir; /* previous working directory */ 74STATIC char *cdcomppath; 75 76int 77cdcmd(argc, argv) |
78 int argc; 79 char **argv; | 78 int argc __unused; 79 char **argv __unused; |
80{ 81 char *dest; 82 char *path; 83 char *p; 84 struct stat statb; 85 int print = 0; 86 87 nextopt(nullstr); --- 120 unchanged lines hidden (view full) --- 208 if (new == stackblock()) 209 STPUTC('/', new); 210 STACKSTRNUL(new); 211} 212 213 214int 215pwdcmd(argc, argv) | 80{ 81 char *dest; 82 char *path; 83 char *p; 84 struct stat statb; 85 int print = 0; 86 87 nextopt(nullstr); --- 120 unchanged lines hidden (view full) --- 208 if (new == stackblock()) 209 STPUTC('/', new); 210 STACKSTRNUL(new); 211} 212 213 214int 215pwdcmd(argc, argv) |
216 int argc; 217 char **argv; | 216 int argc __unused; 217 char **argv __unused; |
218{ 219 if (!getpwd()) 220 error("getcwd() failed: %s", strerror(errno)); 221 out1str(curdir); 222 out1c('\n'); 223 return 0; 224} 225 --- 12 unchanged lines hidden --- | 218{ 219 if (!getpwd()) 220 error("getcwd() failed: %s", strerror(errno)); 221 out1str(curdir); 222 out1c('\n'); 223 return 0; 224} 225 --- 12 unchanged lines hidden --- |