Skip to content

Commit 5f74d42

Browse files
committed
#98 - improved UNC and extended prefix support
1 parent 8571061 commit 5f74d42

File tree

137 files changed

+2951
-1374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+2951
-1374
lines changed

mcsrc/lib/strutil/strescape.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,16 @@ str_unescape (const char *src, gsize src_len, const char *unescaped_chars,
129129
continue;
130130
}
131131

132+
#if defined(WIN32) //WIN32, path/UNC
133+
if (curr_index <= 1 && src[curr_index + 1] == '\\') // retain leading "\\ .."
134+
{
135+
g_string_append_c (ret, '\\');
136+
g_string_append_c (ret, '\\');
137+
++curr_index;
138+
continue;
139+
}
140+
#endif
141+
132142
curr_index++;
133143

134144
if (unescaped_chars == ESCAPE_SHELL_CHARS && src[curr_index] == '$')

mcsrc/lib/vfs/path.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,19 @@ vfs_path_from_str_uri_parser (char *path)
463463
if (path == NULL)
464464
return vfs_path_new (FALSE);
465465

466+
#if defined(WIN32) //WIN32, drive/path
467+
if (path[0] == '"' || path[0] == '\'') {
468+
size_t plen = strlen(path);
469+
if (plen > 1 && path[0] == path[plen - 1]) { // quoted, remove
470+
plen -= 2;
471+
memmove(path, path + 1, plen);
472+
path[plen] = 0;
473+
}
474+
}
475+
path_is_absolute = IS_PATH_SEP(*path) || (isalpha((unsigned char)path[0]) && path[1] == ':');
476+
#else
466477
path_is_absolute = IS_PATH_SEP (*path);
478+
#endif
467479
#ifdef HAVE_CHARSET
468480
path_is_absolute = path_is_absolute || g_str_has_prefix (path, VFS_ENCODING_PREFIX);
469481
#endif

mcsrc/lib/widget/input_complete.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
/*** global variables ****************************************************************************/
5656

5757
/* Linux declares environ in <unistd.h>, so don't repeat it here. */
58-
#if !defined(_MSC_VER) && !defined(__WATCOMC__) //WIN32/c11
58+
#if !defined(_MSC_VER) && !defined(__WATCOMC__) && !defined(__MINGW32__) //WIN32/c11
5959
#if !HAVE_DECL_ENVIRON
6060
extern char **environ;
6161
#endif

mcwin32/ChangeLog.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Thu Feb 20 12:11:28 2025 adamy
1+
Fri Mar 7 11:26:56 2025 adamy
22

33
* build-231
44

@@ -16,6 +16,7 @@ Thu Feb 20 12:11:28 2025 adamy
1616
o glib 2.54.3 (#102)
1717
o zlib-1.3.1 (#102)
1818
o mbedtls-3.6.2 (#100)
19+
o improved UNC and extended prefix support, plus stat optmisations (#98)
1920
o libssh2-1.11.1 (#95)
2021
o enhanced utf8 support, directory plus username; non-ascii user name support (#97)
2122
o EXDEV, cross-device link on rename failure; allowing alt move logic (#85)

mcwin32/libw32/Makefile.in

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
# -*- mode: mak; indent-tabs-mode: t; tab-width: 8 -*-
2-
# $Id: Makefile.in,v 1.27 2024/02/03 17:22:14 cvsuser Exp $
2+
# $Id: Makefile.in,v 1.28 2025/03/06 16:59:45 cvsuser Exp $
33
# libwin32 makefile.
44
#
55
#
6-
# Copyright (c) 2007, 2012 - 2024 Adam Young.
6+
# Copyright (c) 2007, 2012 - 2025 Adam Young.
77
# All rights reserved.
88
#
99
# This file is part of the Midnight Commander.
1010
#
1111
# The Midnight Commander is free software: you can redistribute it
1212
# and/or modify it under the terms of the GNU General Public License as
13-
# published by the Free Software Foundation, either version 3 of the License,
14-
# or (at your option) any later version.
13+
# published by the Free Software Foundation, version 3.
1514
#
1615
# The Midnight Commander is distributed in the hope that it will be useful,
1716
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -124,18 +123,20 @@ VERSIONSPEC= $(subst .,:,$(VERSION))
124123

125124
CSOURCES=\
126125
w32_access.c \
126+
w32_basename.c \
127127
w32_check.c \
128128
w32_child.c \
129129
w32_chmod.c \
130130
w32_chown.c \
131131
w32_close.c \
132132
w32_dir.c \
133133
w32_dirent.c \
134-
w32_wdirent.c \
135-
w32_dlfcn.c \
136134
w32_direntunc.c \
135+
w32_dirname.c \
136+
w32_dlfcn.c \
137137
w32_domainname.c \
138138
w32_err.c \
139+
w32_wdirent.c \
139140
w32_errno.c \
140141
w32_flock.c \
141142
w32_fcntl.c \

mcwin32/libw32/alloca.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef LIBW32_ALLOCA_H_INCLUDED
22
#define LIBW32_ALLOCA_H_INCLUDED
33
#include <edidentifier.h>
4-
__CIDENT_RCSID(gr_libw32_alloca_h,"$Id: alloca.h,v 1.9 2025/02/16 12:04:04 cvsuser Exp $")
4+
__CIDENT_RCSID(gr_libw32_alloca_h,"$Id: alloca.h,v 1.10 2025/03/06 16:59:45 cvsuser Exp $")
55
__CPRAGMA_ONCE
66

77
/* -*- mode: c; indent-width: 4; -*- */
@@ -15,7 +15,6 @@ __CPRAGMA_ONCE
1515
* The applications are free software: you can redistribute it
1616
* and/or modify it under the terms of the GNU General Public License as
1717
* published by the Free Software Foundation, version 3.
18-
* or (at your option) any later version.
1918
*
2019
* Redistributions of source code must retain the above copyright
2120
* notice, and must be distributed with the license document above.

mcwin32/libw32/arpa/ftp.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef LIBW32_ARPA_FTP_H_INCLUDED
22
#define LIBW32_ARPA_FTP_H_INCLUDED
33
#include <edidentifier.h>
4-
__CIDENT_RCSID(gr_libw32_arpa_ftp_h,"$Id: ftp.h,v 1.6 2024/03/14 18:54:32 cvsuser Exp $")
4+
__CIDENT_RCSID(gr_libw32_arpa_ftp_h,"$Id: ftp.h,v 1.7 2025/03/06 16:59:47 cvsuser Exp $")
55
__CPRAGMA_ONCE
66

77
/* -*- mode: c; indent-width: 4; -*- */
@@ -13,8 +13,7 @@ __CPRAGMA_ONCE
1313
*
1414
* The Midnight Commander is free software: you can redistribute it
1515
* and/or modify it under the terms of the GNU General Public License as
16-
* published by the Free Software Foundation, either version 3 of the License,
17-
* or (at your option) any later version.
16+
* published by the Free Software Foundation, version 3.
1817
*
1918
* The Midnight Commander is distributed in the hope that it will be useful,
2019
* but WITHOUT ANY WARRANTY; without even the implied warranty of

mcwin32/libw32/arpa/inet.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef LIBW32_ARPA_INET_H_INCLUDED
22
#define LIBW32_ARPA_INET_H_INCLUDED
33
#include <edidentifier.h>
4-
__CIDENT_RCSID(gr_libw32_arpa_inet_h,"$Id: inet.h,v 1.5 2024/03/14 18:54:32 cvsuser Exp $")
4+
__CIDENT_RCSID(gr_libw32_arpa_inet_h,"$Id: inet.h,v 1.6 2025/03/06 16:59:47 cvsuser Exp $")
55
__CPRAGMA_ONCE
66

77
/* -*- mode: c; indent-width: 4; -*- */
@@ -13,8 +13,7 @@ __CPRAGMA_ONCE
1313
*
1414
* The Midnight Commander is free software: you can redistribute it
1515
* and/or modify it under the terms of the GNU General Public License as
16-
* published by the Free Software Foundation, either version 3 of the License,
17-
* or (at your option) any later version.
16+
* published by the Free Software Foundation, version 3.
1817
*
1918
* The Midnight Commander is distributed in the hope that it will be useful,
2019
* but WITHOUT ANY WARRANTY; without even the implied warranty of

mcwin32/libw32/dirent.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef LIBW32_DIRENT_H_INCLUDED
22
#define LIBW32_DIRENT_H_INCLUDED
33
#include <edidentifier.h>
4-
__CIDENT_RCSID(gr_libw32_dirent_h,"$Id: dirent.h,v 1.19 2025/02/13 17:55:23 cvsuser Exp $")
4+
__CIDENT_RCSID(gr_libw32_dirent_h,"$Id: dirent.h,v 1.20 2025/03/06 16:59:45 cvsuser Exp $")
55
__CPRAGMA_ONCE
66

77
/* -*- mode: c; indent-width: 4; -*- */
@@ -16,7 +16,6 @@ __CPRAGMA_ONCE
1616
* The applications are free software: you can redistribute it
1717
* and/or modify it under the terms of the GNU General Public License as
1818
* published by the Free Software Foundation, version 3.
19-
* or (at your option) any later version.
2019
*
2120
* Redistributions of source code must retain the above copyright
2221
* notice, and must be distributed with the license document above.

mcwin32/libw32/dlfcn.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef GR_DLFCN_H_INCLUDED
22
#define GR_DLFCN_H_INCLUDED
33
#include <edidentifier.h>
4-
__CIDENT_RCSID(gr_libw32_dlfcn_h,"$Id: dlfcn.h,v 1.6 2025/02/13 17:55:24 cvsuser Exp $")
4+
__CIDENT_RCSID(gr_libw32_dlfcn_h,"$Id: dlfcn.h,v 1.7 2025/03/06 16:59:45 cvsuser Exp $")
55
__CPRAGMA_ONCE
66

77
/* -*- mode: c; indent-width: 4; -*- */
@@ -16,7 +16,6 @@ __CPRAGMA_ONCE
1616
* The applications are free software: you can redistribute it
1717
* and/or modify it under the terms of the GNU General Public License as
1818
* published by the Free Software Foundation, version 3.
19-
* or (at your option) any later version.
2019
*
2120
* Redistributions of source code must retain the above copyright
2221
* notice, and must be distributed with the license document above.

0 commit comments

Comments
 (0)