/[path-sandbox]/trunk/src/canonicalize.c
Gentoo

Diff of /trunk/src/canonicalize.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 188 Revision 189
19 19
20/* 20/*
21 * $Header$ 21 * $Header$
22 */ 22 */
23 23
24#include <stdio.h>
24#include <stdlib.h> 25#include <stdlib.h>
25#include <string.h> 26#include <string.h>
26#include <unistd.h> 27#include <unistd.h>
27#include <limits.h> 28#include <limits.h>
28#include <sys/param.h> 29#include <sys/param.h>
34#include "localdecls.h" 35#include "localdecls.h"
35 36
36#ifndef __set_errno 37#ifndef __set_errno
37# define __set_errno(val) errno = (val) 38# define __set_errno(val) errno = (val)
38#endif 39#endif
40
41extern char *egetcwd(char *, size_t);
39 42
40/* Return the canonical absolute name of file NAME. A canonical name 43/* Return the canonical absolute name of file NAME. A canonical name
41 does not contain any `.', `..' components nor any repeated path 44 does not contain any `.', `..' components nor any repeated path
42 separators ('/') or symlinks. All path components must exist. If 45 separators ('/') or symlinks. All path components must exist. If
43 RESOLVED is null, the result is malloc'd; otherwise, if the 46 RESOLVED is null, the result is malloc'd; otherwise, if the
54 * resolve symlinks. Also prepended a 'e' to functions that 57 * resolve symlinks. Also prepended a 'e' to functions that
55 * I did not rip out. 58 * I did not rip out.
56 * 59 *
57 */ 60 */
58 61
59SB_STATIC char * 62char *
60erealpath(const char *name, char *resolved) 63erealpath(const char *name, char *resolved)
61{ 64{
62 char *rpath, *dest; 65 char *rpath, *dest;
63 const char *start, *end, *rpath_limit; 66 const char *start, *end, *rpath_limit;
64 long int path_max; 67 long int path_max;

Legend:
Removed from v.188  
changed lines
  Added in v.189

  ViewVC Help
Powered by ViewVC 1.1.20