@@ -26,14 +26,15 @@ static void check_for_reg_data_type_usage(migratorContext *ctx, Cluster whichClu
26
26
* such as is suitable for arguments to builtin commands
27
27
* like RMDIR and DEL.
28
28
*/
29
- static char * fix_path_separator (char * path )
29
+ static char *
30
+ fix_path_separator (migratorContext * ctx , char * path )
30
31
{
31
32
#ifdef WIN32
32
33
33
34
char * result ;
34
35
char * c ;
35
36
36
- result = pg_strdup (path );
37
+ result = pg_strdup (ctx , path );
37
38
38
39
for (c = result ; * c != '\0' ; c ++ )
39
40
if (* c == '/' )
@@ -431,7 +432,7 @@ create_script_for_old_cluster_deletion(migratorContext *ctx,
431
432
#endif
432
433
433
434
/* 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 ));
435
436
436
437
/* delete old cluster's alternate tablespaces */
437
438
for (tblnum = 0 ; tblnum < ctx -> num_tablespaces ; tblnum ++ )
@@ -449,15 +450,15 @@ create_script_for_old_cluster_deletion(migratorContext *ctx,
449
450
/* remove PG_VERSION? */
450
451
if (GET_MAJOR_VERSION (ctx -> old .major_version ) <= 804 )
451
452
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 ),
454
455
PATH_SEPARATOR );
455
456
456
457
for (dbnum = 0 ; dbnum < ctx -> new .dbarr .ndbs ; dbnum ++ )
457
458
{
458
459
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 ),
461
462
PATH_SEPARATOR , ctx -> old .dbarr .dbs [dbnum ].db_oid );
462
463
}
463
464
}
@@ -468,8 +469,8 @@ create_script_for_old_cluster_deletion(migratorContext *ctx,
468
469
* or a version-specific subdirectory.
469
470
*/
470
471
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 ));
473
474
}
474
475
475
476
fclose (script );
0 commit comments