if (pwd != NULL && pwd->pw_name && len > 0)
{
- vim_strncpy(s, (char_u *)pwd->pw_name, len - 1);
- return OK;
+ vim_strncpy(s, (char_u *)pwd->pw_name, len - 1);
+ return OK;
}
#endif
*s = NUL;
BPTR seg = LoadSeg(name);
if (seg && GetSegListInfoTags(seg, GSLI_Native, NULL, TAG_DONE) !=
- GetSegListInfoTags(seg, GSLI_68KHUNK, NULL, TAG_DONE))
+ GetSegListInfoTags(seg, GSLI_68KHUNK, NULL, TAG_DONE))
{
- // Test if file permissions allow execution.
- struct ExamineData *exd = ExamineObjectTags(EX_StringNameInput, name);
+ // Test if file permissions allow execution.
+ struct ExamineData *exd = ExamineObjectTags(EX_StringNameInput, name);
- exe = (exd && !(exd->Protection & EXDF_NO_EXECUTE)) ? 1 : 0;
- FreeDosObject(DOS_EXAMINEDATA, exd);
+ exe = (exd && !(exd->Protection & EXDF_NO_EXECUTE)) ? 1 : 0;
+ FreeDosObject(DOS_EXAMINEDATA, exd);
}
else
{
- exe = 0;
+ exe = 0;
}
UnLoadSeg(seg);
// Search for executable in path if applicable.
if (!exe && use_path)
{
- // Save current working dir.
- BPTR cwd = GetCurrentDir();
- struct PathNode *head = DupCmdPathList(NULL);
-
- // For each entry, recur to check for executable.
- for(struct PathNode *tail = head; !exe && tail;
- tail = (struct PathNode *) BADDR(tail->pn_Next))
- {
- SetCurrentDir(tail->pn_Lock);
- exe = mch_can_exe(name, path, 0);
- }
-
- // Go back to where we were.
- FreeCmdPathList(head);
- SetCurrentDir(cwd);
+ // Save current working dir.
+ BPTR cwd = GetCurrentDir();
+ struct PathNode *head = DupCmdPathList(NULL);
+
+ // For each entry, recur to check for executable.
+ for(struct PathNode *tail = head; !exe && tail;
+ tail = (struct PathNode *) BADDR(tail->pn_Next))
+ {
+ SetCurrentDir(tail->pn_Lock);
+ exe = mch_can_exe(name, path, 0);
+ }
+
+ // Go back to where we were.
+ FreeCmdPathList(head);
+ SetCurrentDir(cwd);
}
#endif
return exe;
mch_get_shellsize(void)
{
if (!term_console)
- return FAIL;
+ return FAIL;
if (raw_in && raw_out)
{
- // Save current console mode.
- int old_tmode = cur_tmode;
- char ctrl[] = "\x9b""0 q";
-
- // Set RAW mode.
- mch_settmode(TMODE_RAW);
-
- // Write control sequence to console.
- if (Write(raw_out, ctrl, sizeof(ctrl)) == sizeof(ctrl))
- {
- char scan[] = "\x9b""1;1;%d;%d r",
- answ[sizeof(scan) + 8] = { '\0' };
-
- // Read return sequence from input.
- if (Read(raw_in, answ, sizeof(answ) - 1) > 0)
- {
- // Parse result and set Vim globals.
- if (sscanf(answ, scan, &Rows, &Columns) == 2)
- {
- // Restore console mode.
- mch_settmode(old_tmode);
- return OK;
- }
- }
- }
-
- // Restore console mode.
- mch_settmode(old_tmode);
+ // Save current console mode.
+ int old_tmode = cur_tmode;
+ char ctrl[] = "\x9b""0 q";
+
+ // Set RAW mode.
+ mch_settmode(TMODE_RAW);
+
+ // Write control sequence to console.
+ if (Write(raw_out, ctrl, sizeof(ctrl)) == sizeof(ctrl))
+ {
+ char scan[] = "\x9b""1;1;%d;%d r",
+ answ[sizeof(scan) + 8] = { '\0' };
+
+ // Read return sequence from input.
+ if (Read(raw_in, answ, sizeof(answ) - 1) > 0)
+ {
+ // Parse result and set Vim globals.
+ if (sscanf(answ, scan, &Rows, &Columns) == 2)
+ {
+ // Restore console mode.
+ mch_settmode(old_tmode);
+ return OK;
+ }
+ }
+ }
+
+ // Restore console mode.
+ mch_settmode(old_tmode);
}
// I/O error. Default size fallback.
static int g_nMouseClick = -1; // mouse status
static int g_xMouse; // mouse x coordinate
static int g_yMouse; // mouse y coordinate
-static DWORD g_cmodein = 0; // Original console input mode
-static DWORD g_cmodeout = 0; // Original console output mode
+static DWORD g_cmodein = 0; // Original console input mode
+static DWORD g_cmodeout = 0; // Original console output mode
/*
* Enable or disable mouse input
// to get and still room in the buffer (up to two bytes for a char and
// three bytes for a modifier).
while ((typeaheadlen == 0 || WaitForChar(0L, FALSE))
- && typeaheadlen + 5 + TYPEAHEADSPACE <= TYPEAHEADLEN)
+ && typeaheadlen + 5 + TYPEAHEADSPACE <= TYPEAHEADLEN)
{
if (typebuf_changed(tb_change_cnt))
{
p = sp;
// If restoreFG and FG are connected, the restoreFG can be
- // omitted.
+ // omitted.
if (sgrn2((sp = sgrnc(p, 39)), 38))
p = sp;
typedef NTSTATUS (NTAPI *PfnNtClose)(
HANDLE Handle);
typedef NTSTATUS (NTAPI *PfnNtSetEaFile)(
- HANDLE FileHandle,
- PIO_STATUS_BLOCK IoStatusBlock,
- PVOID Buffer,
- ULONG Length);
+ HANDLE FileHandle,
+ PIO_STATUS_BLOCK IoStatusBlock,
+ PVOID Buffer,
+ ULONG Length);
typedef NTSTATUS (NTAPI *PfnNtQueryEaFile)(
HANDLE FileHandle,
PIO_STATUS_BLOCK IoStatusBlock,
PULONG EaIndex,
BOOLEAN RestartScan);
typedef NTSTATUS (NTAPI *PfnNtQueryInformationFile)(
- HANDLE FileHandle,
- PIO_STATUS_BLOCK IoStatusBlock,
- PVOID FileInformation,
- ULONG Length,
+ HANDLE FileHandle,
+ PIO_STATUS_BLOCK IoStatusBlock,
+ PVOID FileInformation,
+ ULONG Length,
FILE_INFORMATION_CLASS FileInformationClass);
typedef VOID (NTAPI *PfnRtlInitUnicodeString)(
PUNICODE_STRING DestinationString,