Skip to content

Commit cd8c3be

Browse files
authored
build-232 (#119)
# upgrades/bug-fixes * documentation enhancements * mcstart, file-extension utility (#124) * MSTerminal maximize disabled (#122) * obey NODRIVES group policy (#121) * getmntinfo, networked/mapped drive (#120) * script enhancements, MC_XDG_OPEN as "start" (#119) * non-ascii group name handling (#118) * mandoc / mchelp integration (#116) * stat/seek64 (#35) and (#89) * unzip vfs (#88) * mc-wrapper's (#69) * ESC timeout, -1 enables an infinite wait (#36)
1 parent b7b7a86 commit cd8c3be

File tree

192 files changed

+262878
-4465
lines changed

Some content is hidden

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

192 files changed

+262878
-4465
lines changed

README.md

Lines changed: 124 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99

1010
Windows XP+/32 bit native port of GNU Midnight Commander, based on the [4.8.33](https://midnight-commander.org/wiki/NEWS-4.8.33) release.
1111

12-
Supports both the recent Windows 10 plus the prior legacy console, 16 and 256 colour modes are available within either.
12+
Supports recent Windows 10/11 distributions, both MsTerminal and legacy console, 16 and 256 colour modes are available within all.
1313

1414
Midnight Commander (also known as mc) is a free cross-platform orthodox file manager and a clone of Norton Commander.
1515

1616
Features include the ability work with common archive formats as if they were simply another directory, and to function as an SFTP/FTP client.
17-
Midnight Commander also includes an builtin editor/viewer, features include syntax highlighting for many languages, macros, code snippets,
17+
Midnight Commander also includes an built-in editor/viewer, features include syntax highlighting for many languages, macros, code snippets,
1818
simple integration with external tools, automatic indentation, mouse support, clipboard and the ability to work in both ASCII and hex modes.
1919

2020
Midnight Commander supports accessing remote filesystems through several methods, including SSH’s Secure File Transfer Protocol, SFTP.
@@ -38,6 +38,7 @@ Internal editor.
3838

3939
![](https://github.com/adamyg/mcwin32/blob/master/mcwin32/art/sample05.png?raw=true)
4040

41+
4142
## Installation
4243

4344
Recent distributions are now bundled with an installer, the following shall prompt and then check for available upgrades.
@@ -57,18 +58,136 @@ To utilise *Files transferred over Shell protocol* **(FISH)** over SSH, an ssh c
5758

5859
Finally the internal editor has built-in spell enabled. To utilise aspell is required, you can optionally install [Win32-Aspell](https://github.com/adamyg/aspell-win32).
5960

61+
62+
## Documentation
63+
64+
The primary way to learn about midnight-commander is to use the context-sensitive online help available via **F1**.
65+
66+
![](mcwin32/art/sample06.png?raw=true)
67+
68+
Comprehensive manual pages serve as the main source of official documentation. These pages cover topics such as "mc," "mcdiff," "mcedit," and "mcview," which can be accessed through the **mchelp** utility. This utility presents relevant information on each topic using the internal viewer of _Midnight Commander_.
69+
70+
```
71+
mchelp mc
72+
```
73+
74+
## Configuration
75+
76+
### Run-time profile
77+
78+
The location of run-time configuration elements will differ across installations, and this can be checked using the ```--datadir-info``` option. Additionally, these elements are influenced by the MC_DATADIR environment variable. Further details can be found in __mchelp mc__.
79+
80+
81+
```
82+
$ mc --datadir-info
83+
84+
Home directory: C:\Users\user
85+
Profile root directory: C:\Users\user
86+
Temporary directory: C:/Users/user/AppData/Local/Temp/mc-user/mc-user
87+
88+
[System data]
89+
Config directory: C:/Program Files (x86)/Midnight Commander/etc/
90+
Data directory: C:/Program Files (x86)/Midnight Commander/share/
91+
File extension handlers: C:/Program Files (x86)/Midnight Commander/plugin/
92+
VFS plugins and scripts: C:/Program Files (x86)/Midnight Commander/plugin/
93+
extfs.d: C:/Program Files (x86)/Midnight Commander/plugin/extfs.d/
94+
shell: C:/Program Files (x86)/Midnight Commander/plugin/shell/
95+
magic: C:/Program Files (x86)/Midnight Commander/etc/magic
96+
97+
[User data]
98+
Config directory: C:/Users/user/AppData/Roaming/Midnight Commander/
99+
Data directory: C:/Users/user/AppData/Local/Midnight Commander/
100+
skins: C:/Users/user/AppData/Local/Midnight Commander/skins/
101+
extfs.d: C:/Users/user/AppData/Local/Midnight Commander/extfs.d/
102+
shell: C:/Users/user/AppData/Local/Midnight Commander/shell/
103+
mcedit macros: C:/Users/user/AppData/Local/Midnight Commander/mc.macros
104+
mcedit external macros: C:/Users/user/AppData/Local/Midnight Commander/mcedit/macros.d/macro.*
105+
mcedit global-menu: n/a
106+
mcedit local-menu: n/a
107+
mcedit home-menu: C:/Users/user/AppData/Roaming/Midnight Commander/mcedit/menu
108+
Cache directory: C:/Users/user/AppData/Local/Microsoft/Windows/INetCache/Midnight Commander/
109+
```
110+
111+
### Extensions
112+
113+
Midnight Commander is fully extendable, allowing operations bound to file extensions.
114+
115+
Double-clicking on a file will try to execute the command if it is an executable program; and if the extension file has a program specified for the file's extension, the specified program is executed. See [EXTENSIONS](mcwin32/doc/EXTENSIONS.md) for a number of suitable examples.
116+
117+
60118
## Distributions
61119

62-
Latest builds:
120+
### Binaries and installers
121+
122+
Midnight Commander:
63123

64124
* https://github.com/adamyg/mcwin32/releases
65-
* https://sourceforge.net/projects/mcwin32
125+
* https://sourceforge.net/projects/mcwin32 (Mirror)
66126

67127
Aspell:
68128

69129
* https://github.com/adamyg/aspell-win32/releases
70130

71-
Source:
131+
132+
### Source
72133

73134
* https://github.com/adamyg/mcwin32
135+
136+
The project can be built from source, the method dependent on the target host.
137+
See [INSTALL](mcwin32/doc/INSTALL.md) for details, plus working examples are visible within the GitHub workflows.
138+
139+
https://github.com/adamyg/mcwin32f/blob/master/.github/workflows/build.yml
140+
141+
For actively supported tool-chains, configuration profiles are available.
142+
143+
```
144+
cd mcwin32
145+
.\support\vc2019config
146+
```
147+
148+
The following build profile and options shall be available.
149+
150+
```
151+
-
152+
- Configuration:
153+
-
154+
- PackageName: Midnight Commander WIN32
155+
- Version: 4.8.33
156+
-
157+
- ToolChain: Visual Studio 2019
158+
- Compiler: cl / cl
159+
- CFLAGS: -nologo -MD$(RTSUFFIX) -fp:precise
160+
- CXXFLAGS: -nologo -MD$(RTSUFFIX) -EHsc -fp:precise -Zc:offsetof-
161+
- Release: -O2 -GL -Gy -DNDEBUG
162+
- Debug: -Zi -RTC1 -Od
163+
- LDFLAGS: -nologo -MD$(RTSUFFIX)
164+
-
165+
-
166+
- Virtual File Systems: cpio, extfs, shell, ftp, sfs, sftp, tar (see: config.h)
167+
- Screen library: console
168+
- Mouse support: native
169+
- Subshell support: n/a
170+
- Background operations: n/a
171+
- Internal editor: yes
172+
- Diff viewer: yes
173+
-
174+
175+
Review the options above for accuracy.
176+
177+
Execute to build:
178+
179+
"make release" - build software.
180+
181+
To generate an installer:
182+
183+
"make release package" - build installer.
184+
185+
Optionally after installation:
186+
187+
"make release clean" - remove build tree.
188+
189+
```
190+
191+
## Status:
74192

193+
Please feel free to raise tickets on **GitHub** when issues are encountered.

mcsrc/lib/file-entry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ typedef struct
2222
/* File name */
2323
GString *fname;
2424
/* File attributes */
25-
struct stat st;
25+
mc_stat_t st;
2626
/* Key used for comparing names */
2727
char *name_sort_key;
2828
/* Key used for comparing extensions */

mcsrc/lib/lock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ int
201201
lock_file (const vfs_path_t *fname_vpath)
202202
{
203203
char *lockfname = NULL, *newlock, *msg;
204-
struct stat statbuf;
204+
mc_stat_t statbuf;
205205
lock_s *lockinfo;
206206
gboolean is_local;
207207
gboolean symlink_ok = FALSE;
@@ -293,7 +293,7 @@ unlock_file (const vfs_path_t *fname_vpath)
293293
lockfname = lock_build_symlink_name (fname_vpath);
294294
if (lockfname != NULL)
295295
{
296-
struct stat statbuf;
296+
mc_stat_t statbuf;
297297

298298
/* Check if lock exists */
299299
if (lstat (lockfname, &statbuf) != -1)

mcsrc/lib/mcconfig/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ mc_config_t *
107107
mc_config_init (const gchar *ini_path, gboolean read_only)
108108
{
109109
mc_config_t *mc_config;
110-
struct stat st;
110+
mc_stat_t st;
111111

112112
mc_config = g_try_malloc0 (sizeof (mc_config_t));
113113
if (mc_config == NULL)

mcsrc/lib/util.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ resolve_symlinks (const vfs_path_t *vpath)
116116
{
117117
char *p, *p2;
118118
char *buf, *buf2, *q, *r, c;
119-
struct stat mybuf;
119+
mc_stat_t mybuf;
120120

121121
if (vpath->relative)
122122
return NULL;
@@ -1361,7 +1361,7 @@ Q_ (const char *s)
13611361
gboolean
13621362
mc_util_make_backup_if_possible (const char *file_name, const char *backup_suffix)
13631363
{
1364-
struct stat stat_buf;
1364+
mc_stat_t stat_buf;
13651365
char *backup_path;
13661366
gboolean ret;
13671367

mcsrc/lib/util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ char *load_mc_home_file (const char *from, const char *filename, char **allocate
196196
/* uid/gid managing */
197197
void init_groups (void);
198198
void destroy_groups (void);
199-
int get_user_permissions (struct stat *buf);
199+
int get_user_permissions (mc_stat_t *buf);
200200

201201
void init_uid_gid_cache (void);
202202
const char *get_group (gid_t gid);

mcsrc/lib/utilunix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,7 @@ mc_realpath (const char *path, char *resolved_path)
12381238
*/
12391239

12401240
int
1241-
get_user_permissions (struct stat *st)
1241+
get_user_permissions (mc_stat_t *st)
12421242
{
12431243
static gboolean initialized = FALSE;
12441244
static gid_t *groups;

mcsrc/lib/vfs/direntry.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ vfs_s_chdir (const vfs_path_t *vpath)
507507
/* --------------------------- stat and friends ---------------------------- */
508508

509509
static int
510-
vfs_s_internal_stat (const vfs_path_t *vpath, struct stat *buf, int flag)
510+
vfs_s_internal_stat (const vfs_path_t *vpath, mc_stat_t *buf, int flag)
511511
{
512512
struct vfs_s_inode *ino;
513513

@@ -611,18 +611,18 @@ vfs_s_write (void *fh, const char *buffer, size_t count)
611611

612612
/* --------------------------------------------------------------------------------------------- */
613613

614-
static off_t
615-
vfs_s_lseek (void *fh, off_t offset, int whence)
614+
static mc_off_t
615+
vfs_s_lseek (void *fh, mc_off_t offset, int whence)
616616
{
617617
vfs_file_handler_t *file = VFS_FILE_HANDLER (fh);
618-
off_t size = file->ino->st.st_size;
618+
mc_off_t size = file->ino->st.st_size;
619619

620620
if (file->linear == LS_LINEAR_OPEN)
621621
vfs_die ("cannot lseek() after linear_read!");
622622

623623
if (file->handle != -1)
624624
{ /* If we have local file opened, we want to work with it */
625-
off_t retval;
625+
mc_off_t retval;
626626

627627
retval = lseek (file->handle, offset, whence);
628628
if (retval == -1)
@@ -704,7 +704,7 @@ vfs_s_close (void *fh)
704704

705705
static void
706706
vfs_s_print_stats (const char *fs_name, const char *action,
707-
const char *file_name, off_t have, off_t need)
707+
const char *file_name, mc_off_t have, mc_off_t need)
708708
{
709709
if (need != 0)
710710
vfs_print_message (_("%s: %s: %s %3d%% (%lld) bytes transferred"), fs_name, action,
@@ -878,7 +878,7 @@ vfs_s_dir_uptodate (struct vfs_class *me, struct vfs_s_inode *ino)
878878
/* --------------------------------------------------------------------------------------------- */
879879

880880
struct vfs_s_inode *
881-
vfs_s_new_inode (struct vfs_class *me, struct vfs_s_super *super, struct stat *initstat)
881+
vfs_s_new_inode (struct vfs_class *me, struct vfs_s_super *super, mc_stat_t *initstat)
882882
{
883883
struct vfs_s_inode *ino;
884884

@@ -1000,10 +1000,10 @@ vfs_s_entry_compare (const void *a, const void *b)
10001000

10011001
/* --------------------------------------------------------------------------------------------- */
10021002

1003-
struct stat *
1003+
mc_stat_t *
10041004
vfs_s_default_stat (struct vfs_class *me, mode_t mode)
10051005
{
1006-
static struct stat st;
1006+
static mc_stat_t st;
10071007
mode_t myumask;
10081008

10091009
(void) me;
@@ -1041,7 +1041,7 @@ vfs_s_default_stat (struct vfs_class *me, mode_t mode)
10411041
*/
10421042

10431043
void
1044-
vfs_adjust_stat (struct stat *s)
1044+
vfs_adjust_stat (mc_stat_t *s)
10451045
{
10461046
#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
10471047
if (s->st_size == 0)
@@ -1073,7 +1073,7 @@ vfs_s_generate_entry (struct vfs_class *me, const char *name, struct vfs_s_inode
10731073
mode_t mode)
10741074
{
10751075
struct vfs_s_inode *inode;
1076-
struct stat *st;
1076+
mc_stat_t *st;
10771077

10781078
st = vfs_s_default_stat (me, mode);
10791079
inode = vfs_s_new_inode (me, parent->super, st);
@@ -1396,23 +1396,23 @@ vfs_s_open (const vfs_path_t *vpath, int flags, mode_t mode)
13961396
/* --------------------------------------------------------------------------------------------- */
13971397

13981398
int
1399-
vfs_s_stat (const vfs_path_t *vpath, struct stat *buf)
1399+
vfs_s_stat (const vfs_path_t *vpath, mc_stat_t *buf)
14001400
{
14011401
return vfs_s_internal_stat (vpath, buf, FL_FOLLOW);
14021402
}
14031403

14041404
/* --------------------------------------------------------------------------------------------- */
14051405

14061406
int
1407-
vfs_s_lstat (const vfs_path_t *vpath, struct stat *buf)
1407+
vfs_s_lstat (const vfs_path_t *vpath, mc_stat_t *buf)
14081408
{
14091409
return vfs_s_internal_stat (vpath, buf, FL_NONE);
14101410
}
14111411

14121412
/* --------------------------------------------------------------------------------------------- */
14131413

14141414
int
1415-
vfs_s_fstat (void *fh, struct stat *buf)
1415+
vfs_s_fstat (void *fh, mc_stat_t *buf)
14161416
{
14171417
*buf = VFS_FILE_HANDLER (fh)->ino->st;
14181418
return 0;
@@ -1424,11 +1424,11 @@ int
14241424
vfs_s_retrieve_file (struct vfs_class *me, struct vfs_s_inode *ino)
14251425
{
14261426
/* If you want reget, you'll have to open file with O_LINEAR */
1427-
off_t total = 0;
1427+
mc_off_t total = 0;
14281428
char buffer[BUF_8K];
14291429
int handle;
14301430
ssize_t n;
1431-
off_t stat_size = ino->st.st_size;
1431+
mc_off_t stat_size = ino->st.st_size;
14321432
vfs_file_handler_t *fh = NULL;
14331433
vfs_path_t *tmp_vpath;
14341434
struct vfs_s_subclass *s = VFS_SUBCLASS (me);

0 commit comments

Comments
 (0)