Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
c49afcd7
Commit
c49afcd7
authored
Oct 04, 1996
by
Richard M. Stallman
Browse files
(openp): Omit /: from start of file name.
parent
6d7d9efa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
src/lread.c
src/lread.c
+16
-3
No files found.
src/lread.c
View file @
c49afcd7
...
...
@@ -635,9 +635,22 @@ openp (path, str, suffix, storeptr, exec_only)
char
*
esuffix
=
(
char
*
)
index
(
nsuffix
,
':'
);
int
lsuffix
=
esuffix
?
esuffix
-
nsuffix
:
strlen
(
nsuffix
);
/* Concatenate path element/specified name with the suffix. */
strncpy
(
fn
,
XSTRING
(
filename
)
->
data
,
XSTRING
(
filename
)
->
size
);
fn
[
XSTRING
(
filename
)
->
size
]
=
0
;
/* Concatenate path element/specified name with the suffix.
If the directory starts with /:, remove that. */
if
(
XSTRING
(
filename
)
->
size
>
2
&&
XSTRING
(
filename
)
->
data
[
0
]
==
'/'
&&
XSTRING
(
filename
)
->
data
[
1
]
==
':'
)
{
strncpy
(
fn
,
XSTRING
(
filename
)
->
data
+
2
,
XSTRING
(
filename
)
->
size
-
2
);
fn
[
XSTRING
(
filename
)
->
size
-
2
]
=
0
;
}
else
{
strncpy
(
fn
,
XSTRING
(
filename
)
->
data
,
XSTRING
(
filename
)
->
size
);
fn
[
XSTRING
(
filename
)
->
size
]
=
0
;
}
if
(
lsuffix
!=
0
)
/* Bug happens on CCI if lsuffix is 0. */
strncat
(
fn
,
nsuffix
,
lsuffix
);
...
...
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