comparison src/misc2.c @ 10264:c036c0f636d5 v8.0.0029

commit https://github.com/vim/vim/commit/cea912af725c54f4727a0565e31661f6b29c6bb1 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Oct 12 14:20:24 2016 +0200 patch 8.0.0029 Problem: Code for MS-Windows is complicated because of the exceptions for old systems. Solution: Drop support for MS-Windows older than Windows XP. (Ken Takata)
author Christian Brabandt <cb@256bit.org>
date Wed, 12 Oct 2016 14:30:05 +0200
parents cfb38b57d407
children 6ab770e97152
comparison
equal deleted inserted replaced
10263:b758a787983a 10264:c036c0f636d5
1418 1418
1419 /* First count the number of extra bytes required. */ 1419 /* First count the number of extra bytes required. */
1420 length = (unsigned)STRLEN(string) + 3; /* two quotes and a trailing NUL */ 1420 length = (unsigned)STRLEN(string) + 3; /* two quotes and a trailing NUL */
1421 for (p = string; *p != NUL; mb_ptr_adv(p)) 1421 for (p = string; *p != NUL; mb_ptr_adv(p))
1422 { 1422 {
1423 # if defined(WIN32) || defined(DOS) 1423 # ifdef WIN32
1424 if (!p_ssl) 1424 if (!p_ssl)
1425 { 1425 {
1426 if (*p == '"') 1426 if (*p == '"')
1427 ++length; /* " -> "" */ 1427 ++length; /* " -> "" */
1428 } 1428 }
1449 if (escaped_string != NULL) 1449 if (escaped_string != NULL)
1450 { 1450 {
1451 d = escaped_string; 1451 d = escaped_string;
1452 1452
1453 /* add opening quote */ 1453 /* add opening quote */
1454 # if defined(WIN32) || defined(DOS) 1454 # ifdef WIN32
1455 if (!p_ssl) 1455 if (!p_ssl)
1456 *d++ = '"'; 1456 *d++ = '"';
1457 else 1457 else
1458 # endif 1458 # endif
1459 *d++ = '\''; 1459 *d++ = '\'';
1460 1460
1461 for (p = string; *p != NUL; ) 1461 for (p = string; *p != NUL; )
1462 { 1462 {
1463 # if defined(WIN32) || defined(DOS) 1463 # ifdef WIN32
1464 if (!p_ssl) 1464 if (!p_ssl)
1465 { 1465 {
1466 if (*p == '"') 1466 if (*p == '"')
1467 { 1467 {
1468 *d++ = '"'; 1468 *d++ = '"';
1501 1501
1502 MB_COPY_CHAR(p, d); 1502 MB_COPY_CHAR(p, d);
1503 } 1503 }
1504 1504
1505 /* add terminating quote and finish with a NUL */ 1505 /* add terminating quote and finish with a NUL */
1506 # if defined(WIN32) || defined(DOS) 1506 # ifdef WIN32
1507 if (!p_ssl) 1507 if (!p_ssl)
1508 *d++ = '"'; 1508 *d++ = '"';
1509 else 1509 else
1510 # endif 1510 # endif
1511 *d++ = '\''; 1511 *d++ = '\'';