Skip to content

Commit e62ad18

Browse files
committed
Unbreak Windows builds on 9.0 broken by 4397c51.
1 parent 4397c51 commit e62ad18

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

contrib/pg_upgrade/check.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ static void check_for_reg_data_type_usage(migratorContext *ctx, Cluster whichClu
2626
* such as is suitable for arguments to builtin commands
2727
* like RMDIR and DEL.
2828
*/
29-
static char *fix_path_separator(char *path)
29+
static char *
30+
fix_path_separator(migratorContext *ctx, char *path)
3031
{
3132
#ifdef WIN32
3233

3334
char *result;
3435
char *c;
3536

36-
result = pg_strdup(path);
37+
result = pg_strdup(ctx, path);
3738

3839
for (c = result; *c != '\0'; c++)
3940
if (*c == '/')
@@ -431,7 +432,7 @@ create_script_for_old_cluster_deletion(migratorContext *ctx,
431432
#endif
432433

433434
/* delete old cluster's default tablespace */
434-
fprintf(script, RMDIR_CMD " %s\n", fix_path_separator(ctx->old.pgdata));
435+
fprintf(script, RMDIR_CMD " %s\n", fix_path_separator(ctx, ctx->old.pgdata));
435436

436437
/* delete old cluster's alternate tablespaces */
437438
for (tblnum = 0; tblnum < ctx->num_tablespaces; tblnum++)
@@ -449,15 +450,15 @@ create_script_for_old_cluster_deletion(migratorContext *ctx,
449450
/* remove PG_VERSION? */
450451
if (GET_MAJOR_VERSION(ctx->old.major_version) <= 804)
451452
fprintf(script, RM_CMD " %s%s%cPG_VERSION\n",
452-
fix_path_separator(ctx->tablespaces[tblnum]),
453-
fix_path_separator(ctx->old.tablespace_suffix),
453+
fix_path_separator(ctx, ctx->tablespaces[tblnum]),
454+
fix_path_separator(ctx, ctx->old.tablespace_suffix),
454455
PATH_SEPARATOR);
455456

456457
for (dbnum = 0; dbnum < ctx->new.dbarr.ndbs; dbnum++)
457458
{
458459
fprintf(script, RMDIR_CMD " %s%s%c%d\n",
459-
fix_path_separator(ctx->tablespaces[tblnum]),
460-
fix_path_separator(ctx->old.tablespace_suffix),
460+
fix_path_separator(ctx, ctx->tablespaces[tblnum]),
461+
fix_path_separator(ctx, ctx->old.tablespace_suffix),
461462
PATH_SEPARATOR, ctx->old.dbarr.dbs[dbnum].db_oid);
462463
}
463464
}
@@ -468,8 +469,8 @@ create_script_for_old_cluster_deletion(migratorContext *ctx,
468469
* or a version-specific subdirectory.
469470
*/
470471
fprintf(script, RMDIR_CMD " %s%s\n",
471-
fix_path_separator(ctx->tablespaces[tblnum]),
472-
fix_path_separator(ctx->old.tablespace_suffix));
472+
fix_path_separator(ctx, ctx->tablespaces[tblnum]),
473+
fix_path_separator(ctx, ctx->old.tablespace_suffix));
473474
}
474475

475476
fclose(script);

0 commit comments

Comments
 (0)