| 10808 | } |
| 10809 | |
| 10810 | VarSizeType 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 | |
| 10827 | VarSizeType Script::GetFilespec(char *aBuf) |
| 10828 | { |