Add some awareness of short file names

- Added I_GetLongPathName(). It wraps the Win32 API's GetLongPathName().
  DArgs::CollectFiles() now calls this for every argument it processes, so
  any arguments passed using short file names will be converted to long
  file names. This is mainly of interest so that savegames will never
  record the short file name, which can change based on what else is in
  the directory.
This commit is contained in:
Randy Heit 2013-08-29 21:16:11 -05:00
commit 28e5cc536a
3 changed files with 40 additions and 0 deletions

View file

@ -35,6 +35,7 @@
#include <string.h>
#include "m_argv.h"
#include "cmdlib.h"
#include "i_system.h"
IMPLEMENT_CLASS (DArgs)
@ -391,6 +392,14 @@ void DArgs::CollectFiles(const char *param, const char *extension)
}
}
// Optional: Replace short path names with long path names
#ifdef _WIN32
for (i = 0; i < work.Size(); ++i)
{
work[i] = I_GetLongPathName(work[i]);
}
#endif
// Step 3: Add work back to Argv, as long as it's non-empty.
if (work.Size() > 0)
{