Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit33f2614

Browse files
committed
Remove SEP_CHAR, replace with / or '/' as appropriate.
1 parentf032b70 commit33f2614

File tree

10 files changed

+55
-62
lines changed

10 files changed

+55
-62
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.66 2001/05/22 16:52:49 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.67 2001/05/30 14:15:25 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -336,8 +336,8 @@ static ControlFileData *ControlFile = NULL;
336336

337337

338338
#defineXLogFileName(path,log,seg)\
339-
snprintf(path, MAXPGPATH, "%s%c%08X%08X",\
340-
XLogDir,SEP_CHAR,log, seg)
339+
snprintf(path, MAXPGPATH, "%s/%08X%08X",\
340+
XLogDir, log, seg)
341341

342342
#definePrevBufIdx(idx)\
343343
(((idx) == 0) ? XLogCtl->XLogCacheBlck : ((idx) - 1))
@@ -1300,8 +1300,8 @@ XLogFileInit(uint32 log, uint32 seg,
13001300
* up pre-creating an extra log segment. That seems OK, and better
13011301
* than holding the spinlock throughout this lengthy process.
13021302
*/
1303-
snprintf(tmppath,MAXPGPATH,"%s%cxlogtemp.%d",
1304-
XLogDir,SEP_CHAR,(int)getpid());
1303+
snprintf(tmppath,MAXPGPATH,"%s/xlogtemp.%d",
1304+
XLogDir, (int)getpid());
13051305

13061306
unlink(tmppath);
13071307

@@ -1495,7 +1495,7 @@ MoveOfflineLogs(uint32 log, uint32 seg)
14951495
{
14961496
elog(LOG,"MoveOfflineLogs: %s %s", (XLOG_archive_dir[0]) ?
14971497
"archive" :"remove",xlde->d_name);
1498-
sprintf(path,"%s%c%s",XLogDir,SEP_CHAR,xlde->d_name);
1498+
sprintf(path,"%s/%s",XLogDir,xlde->d_name);
14991499
if (XLOG_archive_dir[0]==0)
15001500
unlink(path);
15011501
}
@@ -1911,9 +1911,8 @@ void
19111911
XLOGPathInit(void)
19121912
{
19131913
/* Init XLOG file paths */
1914-
snprintf(XLogDir,MAXPGPATH,"%s%cpg_xlog",DataDir,SEP_CHAR);
1915-
snprintf(ControlFilePath,MAXPGPATH,"%s%cglobal%cpg_control",
1916-
DataDir,SEP_CHAR,SEP_CHAR);
1914+
snprintf(XLogDir,MAXPGPATH,"%s/pg_xlog",DataDir);
1915+
snprintf(ControlFilePath,MAXPGPATH,"%s/global/pg_control",DataDir);
19171916
}
19181917

19191918
staticvoid

‎src/backend/catalog/catalog.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.40 2001/03/22 03:59:19 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.41 2001/05/30 14:15:26 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -80,7 +80,7 @@ relpath_blind(const char *dbname, const char *relname,
8080
{
8181
/* XXX why is this inconsistent with relpath() ? */
8282
path= (char*)palloc(strlen(DatabasePath)+sizeof(NameData)+2);
83-
sprintf(path,"%s%c%s",DatabasePath,SEP_CHAR,relname);
83+
sprintf(path,"%s/%s",DatabasePath,relname);
8484
}
8585
else
8686
{
@@ -99,7 +99,7 @@ relpath_blind(const char *dbname, const char *relname,
9999
elog(FATAL,"relpath_blind: can't expand path for db %s",
100100
dbname);
101101
path= (char*)palloc(strlen(dbpath)+sizeof(NameData)+2);
102-
sprintf(path,"%s%c%s",dbpath,SEP_CHAR,relname);
102+
sprintf(path,"%s/%s",dbpath,relname);
103103
pfree(dbpath);
104104
}
105105
returnpath;
@@ -122,13 +122,12 @@ relpath(RelFileNode rnode)
122122
{
123123
/* Shared system relations live in {datadir}/global */
124124
path= (char*)palloc(strlen(DataDir)+8+sizeof(NameData)+1);
125-
sprintf(path,"%s%cglobal%c%u",DataDir,SEP_CHAR,SEP_CHAR,rnode.relNode);
125+
sprintf(path,"%s/global/%u",DataDir,rnode.relNode);
126126
}
127127
else
128128
{
129129
path= (char*)palloc(strlen(DataDir)+6+2*sizeof(NameData)+3);
130-
sprintf(path,"%s%cbase%c%u%c%u",DataDir,SEP_CHAR,SEP_CHAR,
131-
rnode.tblNode,SEP_CHAR,rnode.relNode);
130+
sprintf(path,"%s/base/%u/%u",DataDir,rnode.tblNode,rnode.relNode);
132131
}
133132
returnpath;
134133
}
@@ -148,12 +147,12 @@ GetDatabasePath(Oid tblNode)
148147
{
149148
/* Shared system relations live in {datadir}/global */
150149
path= (char*)palloc(strlen(DataDir)+8);
151-
sprintf(path,"%s%cglobal",DataDir,SEP_CHAR);
150+
sprintf(path,"%s/global",DataDir);
152151
}
153152
else
154153
{
155154
path= (char*)palloc(strlen(DataDir)+6+sizeof(NameData)+1);
156-
sprintf(path,"%s%cbase%c%u",DataDir,SEP_CHAR,SEP_CHAR,tblNode);
155+
sprintf(path,"%s/base/%u",DataDir,tblNode);
157156
}
158157
returnpath;
159158
}

‎src/backend/postmaster/postmaster.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*
2929
*
3030
* IDENTIFICATION
31-
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.214 2001/05/2515:45:33 momjian Exp $
31+
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.215 2001/05/30 14:15:26 momjian Exp $
3232
*
3333
* NOTES
3434
*
@@ -272,8 +272,7 @@ checkDataDir(const char *checkdir)
272272
ExitPostmaster(2);
273273
}
274274

275-
snprintf(path,sizeof(path),"%s%cglobal%cpg_control",
276-
checkdir,SEP_CHAR,SEP_CHAR);
275+
snprintf(path,sizeof(path),"%s/global/pg_control",checkdir);
277276

278277
fp=AllocateFile(path,PG_BINARY_R);
279278
if (fp==NULL)

‎src/backend/storage/file/fd.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.78 2001/05/2515:45:33 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.79 2001/05/30 14:15:26 momjian Exp $
1111
*
1212
* NOTES:
1313
*
@@ -580,11 +580,11 @@ filepath(char *filename)
580580
intlen;
581581

582582
/* Not an absolute path name? Then fill in with database path... */
583-
if (*filename!=SEP_CHAR)
583+
if (*filename!='/')
584584
{
585585
len=strlen(DatabasePath)+strlen(filename)+2;
586586
buf= (char*)palloc(len);
587-
sprintf(buf,"%s%c%s",DatabasePath,SEP_CHAR,filename);
587+
sprintf(buf,"%s/%s",DatabasePath,filename);
588588
}
589589
else
590590
{

‎src/backend/utils/cache/relcache.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.134 2001/05/14 22:06:41 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.135 2001/05/30 14:15:26 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -2810,10 +2810,10 @@ write_irels(void)
28102810
* another backend starting at about the same time might crash trying
28112811
* to read the partially-complete file.
28122812
*/
2813-
snprintf(tempfilename,sizeof(tempfilename),"%s%c%s.%d",
2814-
DatabasePath,SEP_CHAR,RELCACHE_INIT_FILENAME,MyProcPid);
2815-
snprintf(finalfilename,sizeof(finalfilename),"%s%c%s",
2816-
DatabasePath,SEP_CHAR,RELCACHE_INIT_FILENAME);
2813+
snprintf(tempfilename,sizeof(tempfilename),"%s/%s.%d",
2814+
DatabasePath,RELCACHE_INIT_FILENAME,MyProcPid);
2815+
snprintf(finalfilename,sizeof(finalfilename),"%s/%s",
2816+
DatabasePath,RELCACHE_INIT_FILENAME);
28172817

28182818
fd=PathNameOpenFile(tempfilename,O_WRONLY |O_CREAT |O_TRUNC |PG_BINARY,0600);
28192819
if (fd<0)

‎src/backend/utils/error/elog.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.83 2001/03/22 03:59:58 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.84 2001/05/30 14:15:26 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -562,8 +562,8 @@ DebugFileOpen(void)
562562
fd=fileno(stderr);
563563
if (fcntl(fd,F_GETFD,0)<0)
564564
{
565-
snprintf(OutputFileName,MAXPGPATH,"%s%cpg.errors.%d",
566-
DataDir,SEP_CHAR,(int)MyProcPid);
565+
snprintf(OutputFileName,MAXPGPATH,"%s/pg.errors.%d",
566+
DataDir, (int)MyProcPid);
567567
fd=open(OutputFileName,O_CREAT |O_APPEND |O_WRONLY,0666);
568568
}
569569
if (fd<0)

‎src/backend/utils/misc/database.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.45 2001/03/22 06:16:19 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.46 2001/05/30 14:15:27 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -52,20 +52,19 @@ ExpandDatabasePath(const char *dbpath)
5252
returnNULL;/* ain't gonna fit nohow */
5353

5454
/* leading path delimiter? then already absolute path */
55-
if (*dbpath==SEP_CHAR)
55+
if (*dbpath=='/')
5656
{
5757
#ifdefALLOW_ABSOLUTE_DBPATHS
58-
cp=strrchr(dbpath,SEP_CHAR);
58+
cp=strrchr(dbpath,'/');
5959
len=cp-dbpath;
6060
strncpy(buf,dbpath,len);
61-
snprintf(&buf[len],MAXPGPATH-len,"%cbase%c%s",
62-
SEP_CHAR,SEP_CHAR, (cp+1));
61+
snprintf(&buf[len],MAXPGPATH-len,"/base/%s", (cp+1));
6362
#else
6463
returnNULL;
6564
#endif
6665
}
6766
/* path delimiter somewhere? then has leading environment variable */
68-
elseif ((cp=strchr(dbpath,SEP_CHAR))!=NULL)
67+
elseif ((cp=strchr(dbpath,'/'))!=NULL)
6968
{
7069
constchar*envvar;
7170

@@ -76,14 +75,12 @@ ExpandDatabasePath(const char *dbpath)
7675
if (envvar==NULL)
7776
returnNULL;
7877

79-
snprintf(buf,sizeof(buf),"%s%cbase%c%s",
80-
envvar,SEP_CHAR,SEP_CHAR, (cp+1));
78+
snprintf(buf,sizeof(buf),"%s/base/%s",envvar, (cp+1));
8179
}
8280
else
8381
{
8482
/* no path delimiter? then add the default path prefix */
85-
snprintf(buf,sizeof(buf),"%s%cbase%c%s",
86-
DataDir,SEP_CHAR,SEP_CHAR,dbpath);
83+
snprintf(buf,sizeof(buf),"%s/base/%s",DataDir,dbpath);
8784
}
8885

8986
/*

‎src/bin/pg_dump/pg_dump.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*
2323
*
2424
* IDENTIFICATION
25-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.209 2001/05/22 16:37:16 petere Exp $
25+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.210 2001/05/30 14:15:27 momjian Exp $
2626
*
2727
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
2828
*
@@ -119,7 +119,7 @@
119119
*
120120
* - Dump dependency information in dumpType. This is necessary
121121
*because placeholder types will have an OID less than the
122-
*OID of the type functions, but type must be created after
122+
*OID of the type functions, but type must be created after
123123
*the functions.
124124
*
125125
* Modifications - 4-Apr-2001 - pjw@rhyme.com.au
@@ -773,10 +773,10 @@ main(int argc, char **argv)
773773

774774
dataOnly=schemaOnly=dumpData=attrNames= false;
775775

776-
if (!strrchr(argv[0],SEP_CHAR))
776+
if (!strrchr(argv[0],'/'))
777777
progname=argv[0];
778778
else
779-
progname=strrchr(argv[0],SEP_CHAR)+1;
779+
progname=strrchr(argv[0],'/')+1;
780780

781781
/* Set defaulty options based on progname */
782782
if (strcmp(progname,"pg_backup")==0)
@@ -2078,7 +2078,7 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
20782078
"order by oid",
20792079
RELKIND_RELATION,RELKIND_SEQUENCE,RELKIND_VIEW);
20802080
}else {
2081-
/*
2081+
/*
20822082
* Before 7.1, view relkind was not set to 'v', so we must check
20832083
* if we have a view by looking for a rule in pg_rewrite.
20842084
*/
@@ -2195,13 +2195,13 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
21952195
else
21962196
tblinfo[i].viewdef=NULL;
21972197

2198-
/*
2198+
/*
21992199
* Get non-inherited CHECK constraints, if any.
22002200
*
22012201
* Exclude inherited CHECKs from CHECK constraints total. If a
22022202
* constraint matches by name and condition with a constraint
22032203
* belonging to a parent class (OR conditions match and both
2204-
* names start with '$', we assume it was inherited.
2204+
* names start with '$', we assume it was inherited.
22052205
*/
22062206
if (tblinfo[i].ncheck>0)
22072207
{
@@ -2313,7 +2313,7 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
23132313
intn;
23142314

23152315
resetPQExpBuffer(query);
2316-
if (g_fout->remoteVersion<70100)
2316+
if (g_fout->remoteVersion<70100)
23172317
{
23182318
/* Fake the LOJ from below */
23192319
appendPQExpBuffer(query,
@@ -2404,7 +2404,7 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
24042404
g_comment_end);
24052405

24062406
resetPQExpBuffer(query);
2407-
appendPQExpBuffer(query,
2407+
appendPQExpBuffer(query,
24082408
"SELECT tgname, tgfoid, tgtype, tgnargs, tgargs, "
24092409
"tgisconstraint, tgconstrname, tgdeferrable, "
24102410
"tgconstrrelid, tginitdeferred, oid, "
@@ -2575,14 +2575,14 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
25752575
if (strcmp(tgconstrrelid,"0")!=0) {
25762576

25772577
if (PQgetisnull(res2,i2,i_tgconstrrelname))
2578-
{
2579-
fprintf(stderr,"getTables(): SELECT produced NULL referenced table name "
2578+
{
2579+
fprintf(stderr,"getTables(): SELECT produced NULL referenced table name "
25802580
"for trigger '%s' on relation '%s' (oid was %s).\n",
25812581
tgname,tblinfo[i].relname,tgconstrrelid);
2582-
exit_nicely(g_conn);
2583-
}
2582+
exit_nicely(g_conn);
2583+
}
25842584

2585-
appendPQExpBuffer(query," FROM %s",
2585+
appendPQExpBuffer(query," FROM %s",
25862586
fmtId(PQgetvalue(res2,i2,i_tgconstrrelname),force_quotes));
25872587
}
25882588
if (!tgdeferrable)
@@ -2770,7 +2770,7 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
27702770
if (g_fout->remoteVersion<70100)
27712771
{
27722772
/* Fake the LOJ below */
2773-
appendPQExpBuffer(q,
2773+
appendPQExpBuffer(q,
27742774
" SELECT a.oid as attoid, a.attnum, a.attname, t.typname, a.atttypmod, "
27752775
" a.attnotnull, a.atthasdef, NULL as atttypedefn "
27762776
" from pg_attribute a, pg_type t "
@@ -4649,7 +4649,7 @@ findLastBuiltinOid_V71(const char *dbname)
46494649
* this is probably not foolproof but comes close
46504650
*/
46514651

4652-
staticOid
4652+
staticOid
46534653
findLastBuiltinOid_V70(void)
46544654
{
46554655
PGresult*res;

‎src/bin/psql/startup.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.48 2001/05/12 19:44:46 petere Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.49 2001/05/30 14:15:27 momjian Exp $
77
*/
88
#include"postgres_fe.h"
99

@@ -102,10 +102,10 @@ main(int argc, char *argv[])
102102
char*password=NULL;
103103
boolneed_pass;
104104

105-
if (!strrchr(argv[0],SEP_CHAR))
105+
if (!strrchr(argv[0],'/'))
106106
pset.progname=argv[0];
107107
else
108-
pset.progname=strrchr(argv[0],SEP_CHAR)+1;
108+
pset.progname=strrchr(argv[0],'/')+1;
109109

110110
if (argc>1)
111111
{

‎src/include/c.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
15-
* $Id: c.h,v 1.92 2001/03/22 04:00:24 momjian Exp $
15+
* $Id: c.h,v 1.93 2001/05/30 14:15:27 momjian Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -594,7 +594,6 @@ typedef NameData *Name;
594594

595595
/* These are for things that are one way on Unix and another on NT */
596596
#defineNULL_DEV"/dev/null"
597-
#defineSEP_CHAR'/'
598597

599598
/* defines for dynamic linking on Win32 platform */
600599
#ifdef__CYGWIN__

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp