Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
9bad936f
Commit
9bad936f
authored
22 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Handle cp, rm, and exec for Win32.
parent
9c264975
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/backend/commands/dbcommands.c
+9
-1
9 additions, 1 deletion
src/backend/commands/dbcommands.c
src/bin/psql/command.c
+11
-5
11 additions, 5 deletions
src/bin/psql/command.c
with
20 additions
and
6 deletions
src/backend/commands/dbcommands.c
+
9
−
1
View file @
9bad936f
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.11
0
2003/0
1/27 0
0:4
6
:4
1 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.11
1
2003/0
4/04 2
0:4
0
:4
4 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -302,7 +302,11 @@ createdb(const CreatedbStmt *stmt)
}
/* Copy the template database to the new location */
#ifndef WIN32
snprintf
(
buf
,
sizeof
(
buf
),
"cp -r '%s' '%s'"
,
src_loc
,
target_dir
);
#else
snprintf
(
buf
,
sizeof
(
buf
),
"xcopy /e /i /q '%s' '%s'"
,
src_loc
,
target_dir
);
#endif
if
(
system
(
buf
)
!=
0
)
{
...
...
@@ -751,7 +755,11 @@ remove_dbdirs(const char *nominal_loc, const char *alt_loc)
}
}
#ifndef WIN32
snprintf
(
buf
,
sizeof
(
buf
),
"rm -rf '%s'"
,
target_dir
);
#else
snprintf
(
buf
,
sizeof
(
buf
),
"rmdir /s /q
\"
%s
\"
"
,
target_dir
);
#endif
if
(
system
(
buf
)
!=
0
)
{
...
...
This diff is collapsed.
Click to expand it.
src/bin/psql/command.c
+
11
−
5
View file @
9bad936f
...
...
@@ -3,7 +3,7 @@
*
* Copyright 2000-2002 by PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.9
4
2003/0
3/20 06:43:3
5 momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.9
5
2003/0
4/04 20:40:4
5 momjian Exp $
*/
#include
"postgres_fe.h"
#include
"command.h"
...
...
@@ -66,8 +66,6 @@ static bool do_edit(const char *filename_arg, PQExpBuffer query_buf);
static
bool
do_connect
(
const
char
*
new_dbname
,
const
char
*
new_user
);
static
bool
do_shell
(
const
char
*
command
);
/*----------
* HandleSlashCmds:
*
...
...
@@ -1515,7 +1513,11 @@ editFile(const char *fname)
sys
=
malloc
(
strlen
(
editorName
)
+
strlen
(
fname
)
+
10
+
1
);
if
(
!
sys
)
return
false
;
sprintf
(
sys
,
"exec %s '%s'"
,
editorName
,
fname
);
sprintf
(
sys
,
#ifndef WIN32
"exec "
#endif
"%s '%s'"
,
editorName
,
fname
);
result
=
system
(
sys
);
if
(
result
==
-
1
)
psql_error
(
"could not start editor %s
\n
"
,
editorName
);
...
...
@@ -1944,7 +1946,11 @@ do_shell(const char *command)
else
exit
(
EXIT_FAILURE
);
}
sprintf
(
sys
,
"exec %s"
,
shellName
);
sprintf
(
sys
,
#ifndef WIN32
"exec "
#endif
"%s"
,
shellName
);
result
=
system
(
sys
);
free
(
sys
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment