Skip to content

Commit

Permalink
Increase Win32 MAX_OSPATH by a factor of 3
Browse files Browse the repository at this point in the history
(the longest UTF-8 encoding for a code point that fits in a single 16-bit code unit)
  • Loading branch information
andrei-drexler committed Oct 19, 2024
1 parent 386dd49 commit 9e41cbf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Quake/q_stdinc.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ typedef struct { float data[4]; } float4_t;
#if defined(MAXPATHLEN)
#define PATH_MAX MAXPATHLEN
#elif defined(_WIN32) && defined(_MAX_PATH)
#define PATH_MAX _MAX_PATH
#define PATH_MAX (_MAX_PATH * 3)
#elif defined(_WIN32) && defined(MAX_PATH)
#define PATH_MAX MAX_PATH
#define PATH_MAX (MAX_PATH * 3)
#else /* fallback */
#define PATH_MAX 1024
#endif
Expand Down
4 changes: 2 additions & 2 deletions Quake/sys_sdl_win.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ qboolean Sys_GetEGSManifestDir (char *path, size_t pathsize)

const char *Sys_GetEGSLauncherData (void)
{
char path[MAX_PATH];
char path[MAX_OSPATH];
char *buf;
FILE *file;
int64_t filesize;
Expand Down Expand Up @@ -655,7 +655,7 @@ static void Sys_FillFindData (winfindfile_t *find)
findfile_t *Sys_FindFirst (const char *dir, const char *ext)
{
winfindfile_t *ret;
char pattern[MAX_PATH];
char pattern[MAX_OSPATH];
wchar_t wpattern[MAX_PATH];
HANDLE handle;
WIN32_FIND_DATAW data;
Expand Down

0 comments on commit 9e41cbf

Please sign in to comment.