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
0f3f018c
Commit
0f3f018c
authored
Jul 07, 2009
by
Chong Yidong
Browse files
* fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
(Fexpand_file_name): Copy string data properly (Bug#3772).
parent
69a197a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
src/ChangeLog
src/ChangeLog
+5
-0
src/fileio.c
src/fileio.c
+9
-7
No files found.
src/ChangeLog
View file @
0f3f018c
2009-07-07 Chong Yidong <cyd@stupidchicken.com>
* fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
(Fexpand_file_name): Copy string data properly (Bug#3772).
2009-07-07 Jan Djärv <jan.h.d@swipnet.se>
* xterm.c (handle_one_xevent): Only call x_check_fullscreen on the
...
...
src/fileio.c
View file @
0f3f018c
...
...
@@ -422,9 +422,11 @@ Given a Unix syntax file name, returns a string ending in slash. */)
return
call2
(
handler
,
Qfile_name_directory
,
filename
);
filename
=
FILE_SYSTEM_CASE
(
filename
);
beg
=
SDATA
(
filename
);
#ifdef DOS_NT
beg
=
strcpy
(
alloca
(
strlen
(
beg
)
+
1
),
beg
);
beg
=
(
unsigned
char
*
)
alloca
(
SBYTES
(
filename
)
+
1
);
bcopy
(
SDATA
(
filename
),
beg
,
SBYTES
(
filename
)
+
1
);
#else
beg
=
SDATA
(
filename
);
#endif
p
=
beg
+
SBYTES
(
filename
);
...
...
@@ -939,10 +941,9 @@ filesystem tree, not (expand-file-name ".." dirname). */)
}
}
nm
=
SDATA
(
name
);
/* Make a local copy of nm[] to protect it from GC in DECODE_FILE below. */
nm
=
strcpy
(
alloca
(
strlen
(
nm
)
+
1
),
nm
);
nm
=
(
unsigned
char
*
)
alloca
(
SBYTES
(
name
)
+
1
);
bcopy
(
SDATA
(
name
),
nm
,
SBYTES
(
name
)
+
1
);
#ifdef DOS_NT
/* Note if special escape prefix is present, but remove for now. */
...
...
@@ -1641,11 +1642,12 @@ those `/' is discarded. */)
if
(
!
NILP
(
handler
))
return
call2
(
handler
,
Qsubstitute_in_file_name
,
filename
);
nm
=
SDATA
(
filename
);
/* Always work on a copy of the string, in case GC happens during
decode of environment variables, causing the original Lisp_String
data to be relocated. */
nm
=
strcpy
(
alloca
(
strlen
(
nm
)
+
1
),
nm
);
nm
=
(
unsigned
char
*
)
alloca
(
SBYTES
(
filename
)
+
1
);
bcopy
(
SDATA
(
filename
),
nm
,
SBYTES
(
filename
)
+
1
);
#ifdef DOS_NT
CORRECT_DIR_SEPS
(
nm
);
substituted
=
(
strcmp
(
nm
,
SDATA
(
filename
))
!=
0
);
...
...
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