Menu

#430 RMDir /r does not remove files with Unicode names

2.0 Series
closed-fixed
General (291)
5
2006-01-13
2005-12-12
Anonymous
No

When the user creates files or directories with
localised names (eg Chinese, Korean) those files and
directories are not properly removed.

Proposed solution:

in Source\exehead\util.c, in the myDelete function
remove the files by their short filename.

void NSISCALL myDelete(char *buf, int flags)
{
static char lbuf[NSIS_MAX_STRLEN];

HANDLE h;
WIN32_FIND_DATA fd;
char *fn;
char *pFName; // <------ new line
int valid_dir=is_valid_instpath(buf);

...
...

pFName = fd.cAlternateFileName[0] == '\0' ?
fd.cFileName : fd.cAlternateFileName;
#ifdef NSIS_SUPPORT_RMDIR
if (pFName[0] != '.' ||
(pFName[1] != '.' && pFName[1]))
#endif//NSIS_SUPPORT_RMDIR
{
mystrcpy(fn,pFName);

My email is fuxiulian@yahoo.com if you want to contact me.

Discussion

  • Amir Szekely

    Amir Szekely - 2005-12-15

    Logged In: YES
    user_id=584402

    Thanks, I'll take a look at this after 2.12.

     
  • Amir Szekely

    Amir Szekely - 2005-12-15
    • assigned_to: nobody --> kichik
     
  • Amir Szekely

    Amir Szekely - 2006-01-13

    Logged In: YES
    user_id=584402

    Thanks, fixed. However, instead of always using the short
    name, as suggested, I've made it only use the short name for
    files contains a question mark. This way, the logs stay nice
    and clean of 8.3 names, unless absolutely necessary.

     
  • Amir Szekely

    Amir Szekely - 2006-01-13
    • summary: RMDir /r does not remove all files --> RMDir /r does not remove files with Unicode names
    • status: open --> closed-fixed
     

Log in to post a comment.