1
0
mirror of https://github.com/winscp/winscp.git synced 2026-10-24 02:28:55 +03:00

56 Commits

Author SHA1 Message Date
Eduardo C.
a8fc40bd0e Portability: let core build with clang on Linux and Windows (#79)
* Cast between closure types with a functional cast, not reinterpret_cast

A Borland __closure is a built-in (code, data) pair, so reinterpret_cast
between two closure types is allowed. Under standard C++ a closure is a
class, and reinterpret_cast cannot convert one class object into another.
The functional cast is the old C-style cast this line had before
"Refactoring old-style casts" (e5efed895), so C++Builder compiles it as it
did then, and a compiler implementing closures as classes can give it the
same meaning.

* Read the knocked FTP port's IPv4 address as 32 bits

The address is read through an unsigned long pointer. That is 32 bits on
Windows (LLP64), so it reads exactly the four address bytes there; on LP64
targets unsigned long is 64 bits, and the read runs four bytes past the
address into whatever follows it in gethostbyname's buffer. The assignment
to the 32-bit s_addr then keeps the right bytes on little-endian machines,
which is why it goes unnoticed, but the over-read is undefined. ULONG is 32
bits on every Windows compiler, as Windows API layers for POSIX define it
too.

* Compile the synchronize checklist's Explorer file operation on Windows only

TSynchronizeChecklistFileOperation carries out a synchronization checklist
through Explorer's IFileOperation (a Shell COM object), so that local
deletions go to the recycle bin with Explorer's progress and undo. Only
WinSCP's Windows GUI uses it (CustomScpExplorer.cpp). Elsewhere neither the
object nor the interfaces exist, and declaring them only to compile would
pretend to a facility that is not there; a frontend on another platform
implements the operation its own way. The class and its implementation are
guarded with _WIN32, which C++Builder defines, so the Windows build is
unchanged.

* Declare the SIOCATMARK result as ULONG, the type p_ioctlsocket takes

network.c declares ioctlsocket as taking ULONG * (its DECL_WINDOWS_FUNCTION)
but passes a u_long. Both are 32 bits on Windows, so the two agree there. On
an LP64 platform u_long is 64 bits and ULONG 32, so the pointer types differ
and the callee would write half the variable. ULONG is what the declaration
says, and is the same type on Windows.

* Pick aes-ni.c's _mm_setr_epi8 for any GCC-compatible compiler

MM_SETR_EPI8 uses _mm_setr_epi8 only under _WIN64, falling back to a brace
initialiser that is correct for MSVC's __m128i (a byte union) but fills
clang's and GCC's (a two-lane vector) wrongly; the _WIN64 condition fixed
that for Win64 builds only. Any compiler defining __GNUC__ (clang does) now
takes the intrinsic.

* Compile WinSCP's Windows-only additions to neon on Windows only

WinSCP builds neon for Win32 alone, and three of its additions assume it:
ne_openssl.c includes <windows.h> (it uses nothing from it), timed_connect
switches the socket to non-blocking mode with Winsock's ioctlsocket instead
of upstream's fcntl, and ne_sock_sspi_init calls into SSPI unconditionally.
On POSIX neon uses BSD sockets directly, so the include is guarded with
_WIN32, the two ioctlsocket branches are taken only on _WIN32 (upstream's
fcntl code beside them is used otherwise), and ne_sock_sspi_init calls SSPI
under HAVE_SSPI, as ne_sock_init's own call does, reporting failure (-1)
without it -- which WebDAVFileSystem.cpp already handles as SSPI being
unavailable. C++Builder defines _WIN32 and neon's Win32 config.h defines
HAVE_SSPI, so the Windows build is unchanged.

* Use in_addr's s_addr in FileZilla's proxy layer

AsyncProxySocketLayer.cpp reaches the IPv4 address through Winsock's union,
sin_addr.S_un.S_addr. Winsock also defines s_addr as exactly that member
(#define s_addr S_un.S_addr), and s_addr is the name BSD sockets and POSIX
give the field; a POSIX in_addr has no S_un. Same field, so the Windows
build is unchanged.

* Pass FileZilla's two tool strings as UnicodeString, not std::wstring

CFileZillaTools::GetClientString and CustomReason return std::wstring; the
rest of the interface between core and FileZilla, and both sides' own code,
use UnicodeString or wchar_t pointers. Built with a 2-byte wchar_t on a
platform whose C++ library assumes 4 (clang's -fshort-wchar on Linux),
std::wstring is unusable: libstdc++ provides basic_string<wchar_t> as a
precompiled extern template for its own wchar_t, and char_traits<wchar_t>
calls the C library's 4-byte wcslen and wmemcpy: a Linux build of
FtpFileSystem.cpp imported wcslen through it. The values are only built from
UnicodeString, compared with empty() and read with c_str(), so UnicodeString
is a direct replacement (IsEmpty for empty). On Windows, where wchar_t is 2
bytes throughout, behaviour is unchanged.

* Build storage key paths with backslashes on every platform

THierarchicalStorage joins registry and INI key paths (Sessions\My site)
through its IncludeTrailingBackslash and ExcludeTrailingBackslash members,
which defer to the RTL functions of those names. The RTL's add and strip the
platform's path delimiter: a backslash on Windows, a slash on POSIX, where
these functions also build local file paths. Keys are not file paths: their
separator is a backslash everywhere, and the INI file's sections say so. The
members now add and strip a backslash themselves; on Windows that is what
the RTL did, so the behaviour there is unchanged. Without this, on POSIX the
current key became "Sessions/", matched no section, and no stored site
loaded.

* Hand neon a copy of the TLS-init closure, not its two pointers

SetNeonTlsInit stores the closure in the neon session by reinterpreting it
as a TMethod and saving its code and data pointers, and ne_init_ssl_session
rebuilds it with MakeMethod. That relies on a closure being exactly those
two pointers, which only Borland's __closure is; with any other closure type
the saved words are its internals, read from a by-value parameter that is
gone by the time neon calls back, and the rebuilt closure is garbage (a
clang build's first WebDAV-over-TLS connection crashed there). The session
now holds a heap copy of the closure, freed by neon's destroy-session hook
-- which also covers the sessions libs3 creates and destroys itself -- and
ne_init_ssl_session calls that copy. On C++Builder the behaviour is the
same, at the cost of one small allocation per session.

* Take CString's search results as const wchar_t *

CString::Find, ReverseFind and FindOneOf search the const string c_str()
returns and keep the result in a wchar_t *. ISO C++ declares wcschr,
wcsrchr, wcsstr and wcspbrk on a const string as returning const wchar_t *,
as MSVC's and newer mingw-w64 headers (llvm-mingw's) do, so the
initialisation does not compile there. The pointers are only compared and
subtracted: const is all they need.

* Index the string a string-list property returns, not the property

GetLocales takes a character of Exts->Strings[Index]. Under clang the
__declspec(property) standing for TStrings::Strings' __property reads a
second subscript as the property's own second index, so the expression is a
two-argument call to the getter and does not compile (parentheses do not
change that). Read into a UnicodeString first, the second subscript indexes
the string the property returns, as under C++Builder.

---------

Co-authored-by: Eduardo Correia <ecorreia@apliant.com.br>
2026-10-20 16:01:54 +02:00
Martin Prikryl
0b57612582 Local directories synchronization fails when preview is disabled, some differences are found, but none are selected
Source commit: ac93deb2ec5b4e47359093e1c87adeb63e0f6c83
2025-11-11 01:21:11 +01:00
Martin Prikryl
3cd64f2a19 Issue 2020 – Synchronize two local directories
https://winscp.net/tracker/2020

Source commit: a0ab887a23e4362bb62824434893a97540b24e4a
2025-10-02 22:14:52 +02:00
Martin Prikryl
3554608bbd Unnecessary qualifier
Source commit: 3560217fc269268a537b9ab1b81ee01520e47ffc
2025-10-02 18:17:36 +02:00
Martin Prikryl
fa31217b53 Refactoring in anticipation of synchronization not always being local-remote (Issue 2020)
Source commit: 2d05944202efceaff012888c6b0de956314c91b6
2025-10-01 15:30:12 +02:00
Martin Prikryl
a01665f294 Factoring out universal path utility functions that will also be used Issue 2020
Source commit: ecc9f746b50cf7f0203dcb08b1db627375cf5295
2025-10-01 01:19:58 +02:00
Martin Prikryl
1d9fe8c955 Changing compiler to Clang/bcc32c
- regarding the ILINK_LibraryPath for Cfg_1_Win32 (Debug):
Win32\Debug (not only Win32c\Debug) needs to be before Win32c\Release, as win32c does not include debug builds of Pascal code - so without that VCL debugging won't work
- IDE insist on adding CC_Suffix to all projects once switched to Clang, although it is only used in WinSCP.cbproj
- UNICODE define: Not needed for build (it's implicit), but CodeInsight does not know it it somehow

Source commit: da06d73eb86caff5ca9cac0185bed54da0da8f07
2025-09-04 07:53:01 +02:00
Martin Prikryl
34ec281e6d Invalid assertion
Caused by Issue 2370

Source commit: 5313aac260b424eeee78c98040085228416db030
2025-08-29 01:11:26 +02:00
Martin Prikryl
cb09038efd Issue 2370 – Files modified by local custom command are not always uploaded to the correct remote directory
https://winscp.net/tracker/2370

Source commit: c54cd934420ee9c59a0572efd306dfccc83ae78e
2025-05-13 00:58:38 +02:00
Martin Prikryl
8d814d4cc3 Issue 2369 – Failure after switching off Thumbnails view
https://winscp.net/tracker/2369

Source commit: 6ca85570d134d8356b6ea553426e0c9945afae86
2025-04-17 01:01:26 +02:00
Martin Prikryl
94172541ab Unused code
Source commit: 77715db778b119a33d8ac6c3fdfe407f6b22d5b0
2025-04-17 00:58:53 +02:00
Martin Prikryl
4dbbc9eb05 Commands to copy paths to the clipboard on the Synchronization checklist window + Bug fix: Local file with invalid characters replaced could not be explorer from the Synchronization checklist window
Source commit: 205edb72d291cca4041e7a8443c37b8749ec27e0
2025-03-07 01:08:03 +01:00
Martin Prikryl
e202af0bdc Issue 2353 – Display and modify S3 file/object tags
https://winscp.net/tracker/2353

Source commit: 2193f9e58d66031ce58013da6a509090582addbe
2025-03-04 15:13:03 +01:00
Michael Lukashov
400bee57cf minor: Fix typos (#59)
Fix various minor typos
2024-12-25 11:25:35 +01:00
Martin Prikryl
cbd7e799df Issue 2318 – Optionally push synchronization actions to queue
https://winscp.net/tracker/2318

Source commit: 8d79009ebeabde5ce762a82d61f36e18c1517d9b
2024-12-23 15:48:13 +01:00
Martin Prikryl
c3aadded64 Factoring out some commons synchronization checklist functions
Source commit: 476fef1cfeea061ec1d35cdb24b2528263eaf247
2024-12-14 01:15:01 +01:00
Martin Prikryl
e40c677e6e Command to find Move candidate on Synchronization checklist window
Source commit: 3afc367ae03df30fa853586a997bfa6fc51ffe53
2024-10-12 01:05:07 +02:00
Martin Prikryl
59393658a0 Bug 2227: Restored ability to duplicate remote folders using "cp" command in secondary shell session even when the SFTP server supports copy-file/copy-data extension
https://winscp.net/tracker/2227

Source commit: 9a0ccf0972df5275cdf7409a6e6d0d1e283a8210
2023-10-04 01:16:01 +02:00
Martin Prikryl
1aee6f1464 Bug 513: Download single large file using multiple SFTP connections
https://winscp.net/tracker/513

Source commit: d57dcad76dfe8b333dfedd8419bce984a181280c
2023-07-27 01:02:51 +02:00
Martin Prikryl
247565d23b Optimization in anticipation of having to parse commandline URL one more time
Source commit: bf2531704d0091b8015811da8ef58374c7516d71
2023-07-01 01:03:57 +02:00
Martin Prikryl
d284d93a83 Merge branch 'master' into dev
# Conflicts:
#	source/forms/ScpCommander.cpp

#	source/windows/WinConfiguration.h

Source commit: 6303fe6c4c5929ade1127007af6321e256f6940d
2022-03-30 01:23:44 +02:00
Martin Prikryl
191729720a Bug 2065 – Scripting command "ls" in FTP session displays timestamps without year even if the server (notably IIS) provided the year, if it did not provide seconds
https://winscp.net/tracker/2065

Source commit: 4d719f707f54a5ce7d1ff2ad327a1159ccb3fefe
2022-03-26 01:07:27 +01:00
Martin Prikryl
d2f9693f1c Bug 1641: Support ACL for S3
https://winscp.net/tracker/1641
(cherry picked from commit 9b304c1b32)

# Conflicts:
#	source/forms/CustomScpExplorer.h

Source commit: bf3c1b88326df1dc340f6ca06f93953db7c82c27
2021-11-26 14:59:21 +01:00
Martin Prikryl
9b304c1b32 Bug 1641: Support ACL for S3
https://winscp.net/tracker/1641

Source commit: 03a0b16e1a553b6a2791a2276e94a4547ab3451f
2021-11-05 11:15:56 +01:00
Martin Prikryl
bfe5b292e9 Bug 41: Show directory size in file panel
https://winscp.net/tracker/41

Source commit: 65720b4a0c4b3ff88c4b0c116de9f2b13f57480a
2021-05-12 00:57:43 +02:00
Martin Prikryl
98527fe824 Bug 1850: Support clearing GID/UID flag on directories with new versions of GNU coreutils
https://winscp.net/tracker/1850
(cherry picked from commit e31f0b66c7)

Source commit: cd1683ffc98036433af968f26191c562d3db7062
2020-11-26 11:26:34 +01:00
Martin Prikryl
7c0121b5d9 Bug 1893: Basic implementation of local tabs
Source commit: fc01f97bd46c7581fcd9c9ebd5f45c345e50a0d6
2020-11-20 00:45:16 +01:00
Martin Prikryl
e31f0b66c7 Bug 1850: Support clearing GID/UID flag on directories with new versions of GNU coreutils
https://winscp.net/tracker/1850

Source commit: 06807f31167a532b668753db250ed2bc14d2236b
2020-04-07 01:08:07 +02:00
Martin Prikryl
8b0a158bb9 Bug 1747: Consider size of linked file when transferring/synchronizing symbolic link
https://winscp.net/tracker/1747

Source commit: e58dad331f8294c191d16fd8472cb7ad02809fa5
2019-05-23 01:36:27 +02:00
Martin Prikryl
2389dd4a1c File/directory rename can be resolved on Synchronization checklist window
Source commit: a2e0c76a2586ab0584f68dbc81081d6b0912058c
2018-10-04 01:58:16 +02:00
Martin Prikryl
768ba11a3c Estimated Time left was zero at the beginning of big synchronizations
Source commit: e20dedae88820ff1267e5eed62c6da58373f7ccd
2018-08-27 00:58:50 +02:00
Martin Prikryl
ad4fb2091d Showing overall synchronization progress on progress window and taskbar (2nd phase - with overall status - based on sizes)
Source commit: 119383f9b2c39a6924260e5ce8be13ebb46e6850
2018-08-23 01:33:47 +02:00
Martin Prikryl
ddbb9d23e8 Showing overall synchronization progress on progress window and taskbar (by operations count for now only)
Source commit: ed687a18cea4487d37d881e4d669097b171f2700
2018-08-10 02:23:31 +02:00
Martin Prikryl
acfe00019d Bug fix: When synchronization changes preview is turned off, and changes are found, but none of them match synchronization options, no feedback is provided.
Source commit: 73c3a8e6603ed99a805b36fd3381e5e9385295d8
2018-08-09 03:53:53 +02:00
Martin Prikryl
19f9225b37 Calculating sizes of all synchronization transfers at the very beginning and showing the sizes on checklist + Not calculating size of transfers again, if they were calculated already on the checklist
Source commit: 08ed8201139d023e0a1e0794a7c4a426d9d4ad6c
2018-08-09 01:28:02 +02:00
Martin Prikryl
5aad5bc8ef Moving TSynchronizeChecklist to RemoteFiles module (it's a good think overall and we will need to access its inner classes in Terminal.h)
Source commit: b4e958953ece9bc73e5aa2c06263bfbe0e803b1c
2018-08-08 01:47:36 +02:00
Martin Prikryl
41f9c0137f Factoring out IsRealFile function
Source commit: 046570706e02ac13da6ecbde4c6d270637c9af56
2018-07-25 02:03:14 +02:00
Martin Prikryl
6c55046771 Hidden files can be excluded from transfer/synchronization
Source commit: a6c74512eca11eb7106a72b0087b868a0f2bf454
2018-06-26 05:12:12 +02:00
Martin Prikryl
0a08412ec1 Bug 1653: Files can be optionally encrypted when storing them on SFTP server
https://winscp.net/tracker/1653

Source commit: 31d8bb5e3aebe725081c5ad74aa1e10b4f739356
2018-06-14 01:26:55 +02:00
Martin Prikryl
14777c3db0 Treating a star as an unset permission for compatibility with Win32-OpenSSH
Source commit: acc183e0b15a2be8e19735f6929bdaf464a295fa
2018-03-05 16:21:34 +01:00
Martin Prikryl
80e08f8d60 Bug 572: Amazon S3 protocol (directory browsing)
https://winscp.net/tracker/572

Counter StoredSessionsCountS3

Source commit: 20585d3ea3566ee2b638791549e28179eaefbc01
2018-01-28 15:02:56 +01:00
Martin Prikryl
505e5154a9 Removing unused code
Source commit: b1af7321e2b2f498669dd0df309c1fb24a167d91
2018-01-28 00:50:51 +01:00
Martin Prikryl
f8018d0f98 Parallel background uploads
Source commit: 1015897f6614be286e8d8fbb2e059fc831350fcf
2018-01-28 00:43:17 +01:00
Martin Prikryl
f679d63fa5 Bug 1486: When handling WebDAV file URL, use a display name for target local file
https://winscp.net/tracker/1486

Source commit: 91f8cc19d3626ee6dada21425121f77e2cd518a3
2018-01-28 00:01:28 +01:00
Martin Prikryl
5a0adb82f9 Bug 1462: Failure when moving "Download and Delete" operation to background
https://winscp.net/tracker/1462

Source commit: 42d3c5fdb7da6d49bb4f49a3188663a75ed2b5b4
2018-01-27 09:37:46 +01:00
Martin Prikryl
4cc2f46f3a Bug 1424: Autodetected timezone difference for servers not supporting MLST command was not taken into account for time on overwrite confirmation dialog
https://winscp.net/tracker/1424

Source commit: c3c99c63b01c9af8b732447dfa1b8944ffd3ab63
2018-01-26 00:48:52 +01:00
Martin Prikryl
d8f92984b9 First public commit of dev branch
Source commit: 98cb9d870efc1c60826db4398ec35c5cbe809e6a
2018-01-24 14:13:46 +01:00
Martin Prikryl
eb3fe4e01f 5.7.5 2018-01-11 15:38:18 +01:00
Martin Prikryl
b8e0750e5a 5.6.5 2018-01-11 15:37:08 +01:00
Martin Prikryl
87c5906b1d 5.6.4 2018-01-11 15:36:57 +01:00