connect: cache real directory entries for DOS alias output
Remember the real Unix directory entry found during legacy scans so the final DOS name can be generated from the original parent/name pair.
This commit is contained in:
@@ -116,6 +116,28 @@ static DIR_HANDLE dir_handles[MAX_DIRHANDLES];
|
||||
|
||||
static int anz_dirhandles=0;
|
||||
|
||||
|
||||
/* Last real directory entry found by the old DOS scan code.
|
||||
* Some callers rebuild unixname later from the synthetic DOS alias; keep the
|
||||
* real parent/name pair so the final attribute formatter can still generate
|
||||
* a collision-aware 8.3 alias for display.
|
||||
*/
|
||||
static int last_dos_alias_volume = -1;
|
||||
static ino_t last_dos_alias_inode = 0;
|
||||
static uint8 last_dos_alias_parent[300];
|
||||
static uint8 last_dos_alias_real[256];
|
||||
|
||||
static void remember_dos_alias_source(int volume, uint8 *parent, uint8 *real,
|
||||
ino_t inode)
|
||||
{
|
||||
last_dos_alias_volume = volume;
|
||||
last_dos_alias_inode = inode;
|
||||
strmaxcpy(last_dos_alias_parent, parent ? (char*)parent : "",
|
||||
sizeof(last_dos_alias_parent)-1);
|
||||
strmaxcpy(last_dos_alias_real, real ? (char*)real : "",
|
||||
sizeof(last_dos_alias_real)-1);
|
||||
}
|
||||
|
||||
static char *build_unix_name(NW_PATH *nwpath, int modus)
|
||||
/*
|
||||
* returns complete UNIX path
|
||||
@@ -621,6 +643,9 @@ static int func_search_entry(NW_PATH *nwpath, int attrib,
|
||||
okflag = ( ( ( (fs->statb.st_mode & S_IFMT) == S_IFDIR) && (attrib & 0x10))
|
||||
|| ( ( (fs->statb.st_mode & S_IFMT) != S_IFDIR) && !(attrib & 0x10)));
|
||||
if (okflag){
|
||||
*kpath = ' | ||||