MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey-v1.0 / GetFileDir

Method GetFileDir

Source/script.cpp:10810–10825  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10808}
10809
10810VarSizeType Script::GetFileDir(char *aBuf)
10811{
10812 char str[MAX_PATH + 1] = ""; // Set default. Uses +1 to append final backslash for AutoIt2 (.aut) scripts.
10813 strlcpy(str, mFileDir, sizeof(str));
10814 size_t length = strlen(str); // Needed not just for AutoIt2.
10815 // If it doesn't already have a final backslash, namely due to it being a root directory,
10816 // provide one so that it is backward compatible with AutoIt v2:
10817 if (mIsAutoIt2 && length && str[length - 1] != '\\')
10818 {
10819 str[length++] = '\\';
10820 str[length] = '\0';
10821 }
10822 if (aBuf)
10823 strcpy(aBuf, str);
10824 return (VarSizeType)length;
10825}
10826
10827VarSizeType Script::GetFilespec(char *aBuf)
10828{

Callers 1

GetMethod · 0.80

Calls 1

strlcpyFunction · 0.85

Tested by

no test coverage detected