MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / Writable

Function Writable

dbug/dbug.c:2282–2306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2280#ifndef Writable
2281
2282static 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

Callers 1

DBUGOpenFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected