Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
5d7f0d78
Commit
5d7f0d78
authored
Nov 11, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ToLocale -> WideCharToMultiByte (refs #817)
parent
de14672a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
modules/access_filter/timeshift.c
modules/access_filter/timeshift.c
+16
-9
No files found.
modules/access_filter/timeshift.c
View file @
5d7f0d78
...
@@ -564,21 +564,28 @@ static char *GetTmpFilePath( access_t *p_access )
...
@@ -564,21 +564,28 @@ static char *GetTmpFilePath( access_t *p_access )
if
(
psz_dir
==
NULL
)
if
(
psz_dir
==
NULL
)
{
{
#ifdef WIN32
#ifdef WIN32
char
psz_local_dir
[
MAX_PATH
];
DWORD
ret
=
GetTempPathW
(
0
,
NULL
);
int
i_size
;
wchar_t
wdir
[
ret
+
3
];
// can at least old "C:" + nul
wchar_t
*
pwdir
=
wdir
,
pwdir_free
=
NULL
;
i_size
=
GetTempPath
(
MAX_PATH
,
psz_local_dir
);
if
(
GetTempPathW
(
ret
+
1
,
wdir
)
==
0
)
if
(
i_size
<=
0
||
i_size
>
MAX_PATH
)
{
{
if
(
!
getcwd
(
psz_local_dir
,
MAX_PATH
)
)
pwdir_free
=
pwdir
=
_wgetcwd
(
NULL
,
0
);
strcpy
(
psz_local_dir
,
"C:"
);
if
(
pwdir
==
NULL
)
wcscpy
(
wdir
,
L"C:"
);
}
}
psz_dir
=
FromLocaleDup
(
psz_local_dir
);
ret
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
pwdir
,
-
1
,
NULL
,
0
);
char
mbdir
[
ret
];
WideCharToMultiByte
(
CP_UTF8
,
0
,
pwdir
,
-
1
,
mbdir
,
ret
);
if
(
pwdir_free
!=
NULL
)
free
(
pwdir_free
);
/* remove last \\ if any */
/* remove last \\ if any */
if
(
psz_dir
[
strlen
(
psz_dir
)
-
1
]
==
'\\'
)
if
(
mbdir
[
strlen
(
mbdir
)
-
1
]
==
'\\'
)
psz_dir
[
strlen
(
psz_dir
)
-
1
]
=
'\0'
;
mbdir
[
strlen
(
mbdit
)
-
1
]
=
'\0'
;
psz_dir
=
strdup
(
mbdir
);
#else
#else
psz_dir
=
strdup
(
"/tmp"
);
psz_dir
=
strdup
(
"/tmp"
);
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment