1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Add sprintf support, that were were missing.

Add support for snprintf '+', 'h', and %* length settings.
This commit is contained in:
Bruce Momjian
2005-03-16 21:27:23 +00:00
parent ca66797308
commit 712f053587
3 changed files with 118 additions and 49 deletions

View File

@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.141 2005/03/11 17:20:34 momjian Exp $
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.142 2005/03/16 21:27:23 momjian Exp $
*/
#include "postgres_fe.h"
#include "command.h"
@ -1574,11 +1574,13 @@ do_shell(const char *command)
shellName = DEFAULT_SHELL;
sys = pg_malloc(strlen(shellName) + 16);
#ifndef WIN32
sprintf(sys,
/* See EDITOR handling comment for an explaination */
#ifndef WIN32
"exec %s", shellName);
#else
sprintf(sys,
/* See EDITOR handling comment for an explaination */
"%s\"%s\"%s", SYSTEMQUOTE, shellName, SYSTEMQUOTE);
#endif
result = system(sys);