| 2280 | #ifndef Writable |
| 2281 | |
| 2282 | static BOOLEAN Writable(const char *pathname) |
| 2283 | { |
| 2284 | REGISTER BOOLEAN granted; |
| 2285 | REGISTER char *lastslash; |
| 2286 | |
| 2287 | granted= FALSE; |
| 2288 | if (EXISTS(pathname)) |
| 2289 | { |
| 2290 | if (WRITABLE(pathname)) |
| 2291 | granted= TRUE; |
| 2292 | } |
| 2293 | else |
| 2294 | { |
| 2295 | lastslash= strrchr(pathname, '/'); |
| 2296 | if (lastslash != NULL) |
| 2297 | *lastslash= '\0'; |
| 2298 | else |
| 2299 | pathname= "."; |
| 2300 | if (WRITABLE(pathname)) |
| 2301 | granted= TRUE; |
| 2302 | if (lastslash != NULL) |
| 2303 | *lastslash= '/'; |
| 2304 | } |
| 2305 | return granted; |
| 2306 | } |
| 2307 | #endif |
| 2308 | |
| 2309 |