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

Commitdec9184

Browse files
committed
I guess I'd vote for changing the code to be
sys = malloc(strlen(editorName) + strlen(fname) + 10 + 1); if (!sys) return false; sprintf(sys, "exec '%s' '%s'", editorName, fname);(note the added quotes to provide a little protection against spacesand such). Then it's perfectly obvious what the calculation is doing.I don't care about wasting 20-some bytes, but confusing readers of thecode is worth avoiding. regards, tom lane
1 parent538b101 commitdec9184

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

‎doc/TODO

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
TODO list for PostgreSQL
22
========================
3-
Last updated:Wed Aug 1400:57:54 EDT 2002
3+
Last updated:Wed Aug 1401:46:11 EDT 2002
44

55
Current maintainer:Bruce Momjian (pgman@candle.pha.pa.us)
66

@@ -205,7 +205,8 @@ Commands
205205
o Add ALTER TABLE tab SET WITHOUT OIDS
206206

207207
* CLUSTER
208-
o Cluster all tables at once
208+
o Cluster all tables at once using pg_index.indisclustered or primary
209+
key
209210
o Prevent loss of indexes, permissions, inheritance
210211
o Automatically maintain clustering on a table
211212

‎src/bin/psql/command.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000-2002 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.77 2002/08/13 21:04:36 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.78 2002/08/14 05:49:22 momjian Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"command.h"
@@ -1510,10 +1510,10 @@ editFile(const char *fname)
15101510
if (!editorName)
15111511
editorName=DEFAULT_EDITOR;
15121512

1513-
sys=malloc(strlen(editorName)+strlen(fname)+32+1);
1513+
sys=malloc(strlen(editorName)+strlen(fname)+10+1);
15141514
if (!sys)
15151515
return false;
1516-
sprintf(sys,"exec%s %s",editorName,fname);
1516+
sprintf(sys,"exec '%s' '%s'",editorName,fname);
15171517
result=system(sys);
15181518
if (result==-1)
15191519
psql_error("could not start editor %s\n",editorName);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp