summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2024-03-23 18:12:56 +0800
committerPo Lu <luangruo@yahoo.com>2024-03-23 18:12:56 +0800
commit023a5fe5a3bd2f20eb168bc4763fa98e14201fff (patch)
treeb2c5f2c0fcf8d3b26b5957138ae522c11aac47ba /src
parente39cb515a108682b520e499c334a600ee634fbf6 (diff)
downloademacs-023a5fe5a3bd2f20eb168bc4763fa98e14201fff.tar.gz
Minor adjustments to last change
* src/androidvfs.c (android_vfs_convert_name): Simplify. (android_saf_tree_readdir, android_root_name): Remove redundant statements.
Diffstat (limited to 'src')
-rw-r--r--src/androidvfs.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/androidvfs.c b/src/androidvfs.c
index 6a9ddb33c56..a9035ae53c6 100644
--- a/src/androidvfs.c
+++ b/src/androidvfs.c
@@ -5553,7 +5553,6 @@ android_saf_tree_readdir (struct android_vdir *vdir)
chars);
/* Resize dirent to accommodate the decoded text. */
- length = strlen (chars) + 1;
size = offsetof (struct dirent, d_name) + 1 + coding.produced;
dirent = xrealloc (dirent, size);
@@ -6573,15 +6572,11 @@ static struct android_special_vnode special_vnodes[] =
static Lisp_Object
android_vfs_convert_name (const char *name, Lisp_Object coding)
{
- Lisp_Object src_coding, name1;
-
- src_coding = Qutf_8_emacs;
+ Lisp_Object name1;
- /* Convert the contents of the buffer after BUFFER_END
- from the file name coding system to
- special->special_coding_system. */
- AUTO_STRING (file_name, name);
- name1 = code_convert_string_norecord (file_name, src_coding, false);
+ /* Convert the contents of the buffer after BUFFER_END from the file
+ name coding system to special->special_coding_system. */
+ name1 = build_string (name);
name1 = code_convert_string (name1, coding, Qt, true, true, true);
return name1;
}
@@ -6632,7 +6627,7 @@ android_root_name (struct android_vnode *vnode, char *name,
/* Allocate a buffer and copy file_name into the same. */
length = SBYTES (file_name) + 1;
- name = SAFE_ALLOCA (length + 1);
+ name = SAFE_ALLOCA (length);
/* Copy the trailing NULL byte also. */
memcpy (name, SDATA (file_name), length);
@@ -6662,7 +6657,7 @@ android_root_name (struct android_vnode *vnode, char *name,
/* Allocate a buffer and copy file_name into the same. */
length = SBYTES (file_name) + 1;
- name = SAFE_ALLOCA (length + 1);
+ name = SAFE_ALLOCA (length);
/* Copy the trailing NULL byte also. */
memcpy (name, SDATA (file_name), length);