MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / normalizePath

Function normalizePath

lib/core/common.py:2112–2126  ·  view source on GitHub ↗

Returns normalized string representation of a given filepath >>> normalizePath('//var///log/apache.log') '/var/log/apache.log'

(filepath)

Source from the content-addressed store, hash-verified

2110 return retVal
2111
2112def normalizePath(filepath):
2113 """
2114 Returns normalized string representation of a given filepath
2115
2116 >>> normalizePath('//var///log/apache.log')
2117 '/var/log/apache.log'
2118 """
2119
2120 retVal = filepath
2121
2122 if retVal:
2123 retVal = retVal.strip("\r\n")
2124 retVal = ntpath.normpath(retVal) if isWindowsDriveLetterPath(retVal) else re.sub(r"\A/{2,}", "/", posixpath.normpath(retVal))
2125
2126 return retVal
2127
2128def safeFilepathEncode(filepath):
2129 """

Callers 10

_setMetasploitFunction · 0.90
_cleanupOptionsFunction · 0.90
_initVarsMethod · 0.90
uploadShellcodeexecMethod · 0.90
_initVarsMethod · 0.90
uploadIcmpshSlaveMethod · 0.90
webInitMethod · 0.90
getRemoteTempPathMethod · 0.90
udfSetRemotePathMethod · 0.90
getManualDirectoriesFunction · 0.85

Calls 1

isWindowsDriveLetterPathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…