comparison src/os_win32.c @ 835:8bebcabccc2c v7.0e01

updated for version 7.0e01
author vimboss
date Mon, 17 Apr 2006 22:14:47 +0000
parents 23f82b5d2814
children 2c885fab04e3
comparison
equal deleted inserted replaced
834:5117153003bd 835:8bebcabccc2c
2650 */ 2650 */
2651 int 2651 int
2652 mch_can_exe(char_u *name) 2652 mch_can_exe(char_u *name)
2653 { 2653 {
2654 char_u buf[_MAX_PATH]; 2654 char_u buf[_MAX_PATH];
2655 int len = STRLEN(name); 2655 int len = (int)STRLEN(name);
2656 char_u *p; 2656 char_u *p;
2657 2657
2658 if (len >= _MAX_PATH) /* safety check */ 2658 if (len >= _MAX_PATH) /* safety check */
2659 return FALSE; 2659 return FALSE;
2660 2660
3912 /* translate ESC | sequences into faked bios calls */ 3912 /* translate ESC | sequences into faked bios calls */
3913 while (len--) 3913 while (len--)
3914 { 3914 {
3915 /* optimization: use one single write_chars for runs of text, 3915 /* optimization: use one single write_chars for runs of text,
3916 * rather than once per character It ain't curses, but it helps. */ 3916 * rather than once per character It ain't curses, but it helps. */
3917 DWORD prefix = strcspn(s, "\n\r\b\a\033"); 3917 DWORD prefix = (DWORD)strcspn(s, "\n\r\b\a\033");
3918 3918
3919 if (p_wd) 3919 if (p_wd)
3920 { 3920 {
3921 WaitForChar(p_wd); 3921 WaitForChar(p_wd);
3922 if (prefix != 0) 3922 if (prefix != 0)
4063 else if (*p == 'M') 4063 else if (*p == 'M')
4064 { 4064 {
4065 delete_lines(arg1); 4065 delete_lines(arg1);
4066 } 4066 }
4067 4067
4068 len -= p - s; 4068 len -= (int)(p - s);
4069 s = p + 1; 4069 s = p + 1;
4070 break; 4070 break;
4071 4071
4072 4072
4073 /* Three-character escape sequences */ 4073 /* Three-character escape sequences */
4714 4714
4715 /* Copy block of bytes at a time. Abort when something goes wrong. */ 4715 /* Copy block of bytes at a time. Abort when something goes wrong. */
4716 for (done = 0; done < len; done += written) 4716 for (done = 0; done < len; done += written)
4717 { 4717 {
4718 /* (size_t) cast for Borland C 5.5 */ 4718 /* (size_t) cast for Borland C 5.5 */
4719 todo = (size_t)(len - done) > sizeof(buf) ? sizeof(buf) 4719 todo = (DWORD)((size_t)(len - done) > sizeof(buf) ? sizeof(buf)
4720 : (size_t)(len - done); 4720 : (size_t)(len - done));
4721 if (!BackupRead(sh, (LPBYTE)buf, todo, &readcnt, 4721 if (!BackupRead(sh, (LPBYTE)buf, todo, &readcnt,
4722 FALSE, FALSE, context) 4722 FALSE, FALSE, context)
4723 || readcnt != todo 4723 || readcnt != todo
4724 || !WriteFile(hTo, buf, todo, &written, NULL) 4724 || !WriteFile(hTo, buf, todo, &written, NULL)
4725 || written != todo) 4725 || written != todo)
4763 for (;;) 4763 for (;;)
4764 { 4764 {
4765 /* Get the header to find the length of the stream name. If 4765 /* Get the header to find the length of the stream name. If
4766 * the "readcount" is zero we have done all info streams. */ 4766 * the "readcount" is zero we have done all info streams. */
4767 ZeroMemory(&sid, sizeof(WIN32_STREAM_ID)); 4767 ZeroMemory(&sid, sizeof(WIN32_STREAM_ID));
4768 headersize = (char *)&sid.cStreamName - (char *)&sid.dwStreamId; 4768 headersize = (int)((char *)&sid.cStreamName - (char *)&sid.dwStreamId);
4769 if (!BackupRead(sh, (LPBYTE)&sid, headersize, 4769 if (!BackupRead(sh, (LPBYTE)&sid, headersize,
4770 &readcount, FALSE, FALSE, &context) 4770 &readcount, FALSE, FALSE, &context)
4771 || readcount == 0) 4771 || readcount == 0)
4772 break; 4772 break;
4773 4773
4984 { 4984 {
4985 int len; 4985 int len;
4986 4986
4987 /* Convert each Unicode argument to the current codepage. */ 4987 /* Convert each Unicode argument to the current codepage. */
4988 WideCharToMultiByte_alloc(GetACP(), 0, 4988 WideCharToMultiByte_alloc(GetACP(), 0,
4989 ArglistW[i], wcslen(ArglistW[i]) + 1, 4989 ArglistW[i], (int)wcslen(ArglistW[i]) + 1,
4990 (LPSTR *)&argv[i], &len, 0, 0); 4990 (LPSTR *)&argv[i], &len, 0, 0);
4991 if (argv[i] == NULL) 4991 if (argv[i] == NULL)
4992 { 4992 {
4993 /* Out of memory, clear everything. */ 4993 /* Out of memory, clear everything. */
4994 while (i > 0) 4994 while (i > 0)