realpath.c (240410) | realpath.c (249582) |
---|---|
1/* 2 * Copyright (c) 2003 Constantin S. Svintsoff <kostik@iclub.nsu.ru> 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 16 unchanged lines hidden (view full) --- 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29#if defined(LIBC_SCCS) && !defined(lint) 30static char sccsid[] = "@(#)realpath.c 8.1 (Berkeley) 2/16/94"; 31#endif /* LIBC_SCCS and not lint */ 32#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 2003 Constantin S. Svintsoff <kostik@iclub.nsu.ru> 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 16 unchanged lines hidden (view full) --- 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29#if defined(LIBC_SCCS) && !defined(lint) 30static char sccsid[] = "@(#)realpath.c 8.1 (Berkeley) 2/16/94"; 31#endif /* LIBC_SCCS and not lint */ 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/lib/libc/stdlib/realpath.c 240410 2012-09-12 17:05:39Z emaste $"); | 33__FBSDID("$FreeBSD: head/lib/libc/stdlib/realpath.c 249582 2013-04-17 11:40:10Z gabor $"); |
34 35#include "namespace.h" 36#include <sys/param.h> 37#include <sys/stat.h> 38 39#include <errno.h> 40#include <stdlib.h> 41#include <string.h> --- 92 unchanged lines hidden (view full) --- 134 if (next_token[0] == '\0') { 135 /* 136 * Handle consequential slashes. The path 137 * before slash shall point to a directory. 138 * 139 * Only the trailing slashes are not covered 140 * by other checks in the loop, but we verify 141 * the prefix for any (rare) "//" or "/\0" | 34 35#include "namespace.h" 36#include <sys/param.h> 37#include <sys/stat.h> 38 39#include <errno.h> 40#include <stdlib.h> 41#include <string.h> --- 92 unchanged lines hidden (view full) --- 134 if (next_token[0] == '\0') { 135 /* 136 * Handle consequential slashes. The path 137 * before slash shall point to a directory. 138 * 139 * Only the trailing slashes are not covered 140 * by other checks in the loop, but we verify 141 * the prefix for any (rare) "//" or "/\0" |
142 * occurence to not implement lookahead. | 142 * occurrence to not implement lookahead. |
143 */ 144 if (lstat(resolved, &sb) != 0) { 145 if (m) 146 free(resolved); 147 return (NULL); 148 } 149 if (!S_ISDIR(sb.st_mode)) { 150 if (m) --- 99 unchanged lines hidden --- | 143 */ 144 if (lstat(resolved, &sb) != 0) { 145 if (m) 146 free(resolved); 147 return (NULL); 148 } 149 if (!S_ISDIR(sb.st_mode)) { 150 if (m) --- 99 unchanged lines hidden --- |