Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
39fccf02
Commit
39fccf02
authored
Oct 24, 2004
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
On Windows, cause get_progname to strip any .EXE suffix.
Andrew Dunstan
parent
0f845a9f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
4 deletions
+27
-4
src/port/path.c
src/port/path.c
+27
-4
No files found.
src/port/path.c
View file @
39fccf02
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/port/path.c,v 1.3
6 2004/09/24 05:16:35
tgl Exp $
* $PostgreSQL: pgsql/src/port/path.c,v 1.3
7 2004/10/24 22:08:19
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -175,15 +175,38 @@ canonicalize_path(char *path)
/*
* Extracts the actual name of the program as called.
* Extracts the actual name of the program as called -
* stripped of .exe suffix if any
*/
const
char
*
get_progname
(
const
char
*
argv0
)
{
const
char
*
nodir_name
;
if
(
!
last_dir_separator
(
argv0
))
return
argv0
;
nodir_name
=
argv0
;
else
return
last_dir_separator
(
argv0
)
+
1
;
nodir_name
=
last_dir_separator
(
argv0
)
+
1
;
#if defined(__CYGWIN__) || defined(WIN32)
/* strip .exe suffix, regardless of case */
if
(
strlen
(
nodir_name
)
>
4
&&
stricmp
(
nodir_name
+
(
strlen
(
nodir_name
)
-
4
),
EXE
)
==
0
)
{
char
*
progname
;
progname
=
strdup
(
nodir_name
);
if
(
progname
==
NULL
)
{
fprintf
(
stderr
,
"%s: out of memory
\n
"
,
nodir_name
);
exit
(
1
);
}
progname
[
strlen
(
progname
)
-
4
]
=
'\0'
;
nodir_name
=
progname
;
}
#endif
return
nodir_name
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment