A wrapper around canonicalize_filename_mode(), to call it twice when in LOGICAL mode. */
| 113 | /* A wrapper around canonicalize_filename_mode(), |
| 114 | to call it twice when in LOGICAL mode. */ |
| 115 | static char * |
| 116 | realpath_canon (char const *fname, int can_mode) |
| 117 | { |
| 118 | char *can_fname = canonicalize_filename_mode (fname, can_mode); |
| 119 | if (logical && can_fname) /* canonicalize again to resolve symlinks. */ |
| 120 | { |
| 121 | can_mode &= ~CAN_NOLINKS; |
| 122 | char *can_fname2 = canonicalize_filename_mode (can_fname, can_mode); |
| 123 | free (can_fname); |
| 124 | return can_fname2; |
| 125 | } |
| 126 | return can_fname; |
| 127 | } |
| 128 | |
| 129 | /* Test whether canonical prefix is parent or match of path. */ |
| 130 | ATTRIBUTE_PURE |
no outgoing calls
no test coverage detected