Skip to content

Commit a1c6196

Browse files
committed
utils/fs: IWYU + rm redundant path delim
(path delimiter already contained by result of get_temp_dir())
1 parent 6f9c366 commit a1c6196

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

src/utils/fs.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,20 @@
3838

3939
#ifdef HAVE_CONFIG_H
4040
#include "config.h"
41-
#include "config_unix.h"
42-
#include "config_win32.h"
4341
#else
4442
#define SRCDIR ".."
4543
#endif
4644

45+
#include <assert.h>
4746
#include <stdbool.h>
4847
#include <stdio.h>
4948
#include <stdlib.h>
5049
#include <string.h>
5150
#include <sys/stat.h>
5251

53-
#include "debug.h"
54-
#include "utils/fs.h"
55-
#include "utils/macros.h"
56-
#include "utils/string.h"
52+
#ifdef _WIN32
53+
#include <windows.h> // for GetModuleFileNameA, GetTempPathA
54+
#endif
5755

5856
// for get_exec_path
5957
#ifdef __APPLE__
@@ -68,6 +66,11 @@
6866
#include "host.h" // for uv_argv
6967
#endif
7068

69+
#include "debug.h"
70+
#include "utils/fs.h"
71+
#include "utils/macros.h"
72+
#include "utils/string.h"
73+
7174
#define MOD_NAME "[fs] "
7275

7376
/**
@@ -271,7 +274,7 @@ FILE *get_temp_file(const char **filename) {
271274
}
272275
return ret;
273276
#else
274-
snprintf_ch(filename_buf, "%s%s", get_temp_dir(), "/uv.XXXXXX");
277+
snprintf_ch(filename_buf, "%s%s", get_temp_dir(), "uv.XXXXXX");
275278
umask(S_IRWXG|S_IRWXO);
276279
int fd = mkstemp(filename_buf);
277280
if (fd == -1) {

0 commit comments

Comments
 (0)