mkdir.c (127958) | mkdir.c (135718) |
---|---|
1/* 2 * Copyright (c) 1983, 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 25 unchanged lines hidden (view full) --- 34 The Regents of the University of California. All rights reserved.\n"; 35#endif /* not lint */ 36 37#ifndef lint 38static char sccsid[] = "@(#)mkdir.c 8.2 (Berkeley) 1/25/94"; 39#endif /* not lint */ 40#endif 41#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1983, 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 25 unchanged lines hidden (view full) --- 34 The Regents of the University of California. All rights reserved.\n"; 35#endif /* not lint */ 36 37#ifndef lint 38static char sccsid[] = "@(#)mkdir.c 8.2 (Berkeley) 1/25/94"; 39#endif /* not lint */ 40#endif 41#include <sys/cdefs.h> |
42__FBSDID("$FreeBSD: head/bin/mkdir/mkdir.c 127958 2004-04-06 20:06:54Z markm $"); | 42__FBSDID("$FreeBSD: head/bin/mkdir/mkdir.c 135718 2004-09-24 06:57:26Z das $"); |
43 44#include <sys/types.h> 45#include <sys/stat.h> 46 47#include <err.h> 48#include <errno.h> 49#include <libgen.h> 50#include <stdio.h> --- 91 unchanged lines hidden (view full) --- 142 if (p[0] == '/') /* Skip leading '/'. */ 143 ++p; 144 for (first = 1, last = 0; !last ; ++p) { 145 if (p[0] == '\0') 146 last = 1; 147 else if (p[0] != '/') 148 continue; 149 *p = '\0'; | 43 44#include <sys/types.h> 45#include <sys/stat.h> 46 47#include <err.h> 48#include <errno.h> 49#include <libgen.h> 50#include <stdio.h> --- 91 unchanged lines hidden (view full) --- 142 if (p[0] == '/') /* Skip leading '/'. */ 143 ++p; 144 for (first = 1, last = 0; !last ; ++p) { 145 if (p[0] == '\0') 146 last = 1; 147 else if (p[0] != '/') 148 continue; 149 *p = '\0'; |
150 if (p[1] == '\0') | 150 if (!last && p[1] == '\0') |
151 last = 1; 152 if (first) { 153 /* 154 * POSIX 1003.2: 155 * For each dir operand that does not name an existing 156 * directory, effects equivalent to those cased by the 157 * following command shall occcur: 158 * --- 50 unchanged lines hidden --- | 151 last = 1; 152 if (first) { 153 /* 154 * POSIX 1003.2: 155 * For each dir operand that does not name an existing 156 * directory, effects equivalent to those cased by the 157 * following command shall occcur: 158 * --- 50 unchanged lines hidden --- |