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
5617588f
Commit
5617588f
authored
Apr 01, 1995
by
Richard M. Stallman
Browse files
(Fdirectory_files): Fix bug in IS_ANY_SEP usage introduced in Oct 30 change.
parent
387f203c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
src/dired.c
src/dired.c
+16
-15
No files found.
src/dired.c
View file @
5617588f
...
...
@@ -113,7 +113,7 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.\n\
Lisp_Object
dirname
,
full
,
match
,
nosort
;
{
DIR
*
d
;
int
len
gth
;
int
dirname
len
;
Lisp_Object
list
,
name
,
dirfilename
;
Lisp_Object
handler
;
struct
re_pattern_buffer
*
bufp
;
...
...
@@ -174,7 +174,7 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.\n\
report_file_error
(
"Opening directory"
,
Fcons
(
dirname
,
Qnil
));
list
=
Qnil
;
len
gth
=
XSTRING
(
dirname
)
->
size
;
dirname
len
=
XSTRING
(
dirname
)
->
size
;
/* Loop reading blocks */
while
(
1
)
...
...
@@ -191,23 +191,24 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.\n\
{
if
(
!
NILP
(
full
))
{
int
index
=
XSTRING
(
dirname
)
->
size
;
int
total
=
len
+
index
;
int
afterdirindex
=
dirnamelen
;
int
total
=
len
+
dirnamelen
;
int
needsep
=
0
;
/* Decide whether we need to add a directory separator. */
#ifndef VMS
if
(
len
gth
==
0
||
!
IS_ANY_SEP
(
XSTRING
(
dirname
)
->
data
[
len
gth
-
1
]))
total
++
;
if
(
dirname
len
==
0
||
!
IS_ANY_SEP
(
XSTRING
(
dirname
)
->
data
[
dirname
len
-
1
]))
needsep
=
1
;
#endif
/* VMS */
name
=
make_uninit_string
(
total
);
name
=
make_uninit_string
(
total
+
needsep
);
bcopy
(
XSTRING
(
dirname
)
->
data
,
XSTRING
(
name
)
->
data
,
index
);
#ifndef VMS
if
(
length
==
0
||
IS_ANY_SEP
(
XSTRING
(
dirname
)
->
data
[
length
-
1
]))
XSTRING
(
name
)
->
data
[
index
++
]
=
DIRECTORY_SEP
;
#endif
/* VMS */
bcopy
(
dp
->
d_name
,
XSTRING
(
name
)
->
data
+
index
,
len
);
dirnamelen
);
if
(
needsep
)
XSTRING
(
name
)
->
data
[
afterdirindex
++
]
=
DIRECTORY_SEP
;
bcopy
(
dp
->
d_name
,
XSTRING
(
name
)
->
data
+
afterdirindex
,
len
);
}
else
name
=
make_string
(
dp
->
d_name
,
len
);
...
...
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