diff options
| author | Po Lu | 2024-03-23 18:12:56 +0800 |
|---|---|---|
| committer | Po Lu | 2024-03-23 18:12:56 +0800 |
| commit | 023a5fe5a3bd2f20eb168bc4763fa98e14201fff (patch) | |
| tree | b2c5f2c0fcf8d3b26b5957138ae522c11aac47ba | |
| parent | e39cb515a108682b520e499c334a600ee634fbf6 (diff) | |
| download | emacs-023a5fe5a3bd2f20eb168bc4763fa98e14201fff.tar.gz emacs-023a5fe5a3bd2f20eb168bc4763fa98e14201fff.zip | |
Minor adjustments to last change
* src/androidvfs.c (android_vfs_convert_name): Simplify.
(android_saf_tree_readdir, android_root_name): Remove redundant
statements.
| -rw-r--r-- | src/androidvfs.c | 17 |
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) | |||
| 5553 | chars); | 5553 | chars); |
| 5554 | 5554 | ||
| 5555 | /* Resize dirent to accommodate the decoded text. */ | 5555 | /* Resize dirent to accommodate the decoded text. */ |
| 5556 | length = strlen (chars) + 1; | ||
| 5557 | size = offsetof (struct dirent, d_name) + 1 + coding.produced; | 5556 | size = offsetof (struct dirent, d_name) + 1 + coding.produced; |
| 5558 | dirent = xrealloc (dirent, size); | 5557 | dirent = xrealloc (dirent, size); |
| 5559 | 5558 | ||
| @@ -6573,15 +6572,11 @@ static struct android_special_vnode special_vnodes[] = | |||
| 6573 | static Lisp_Object | 6572 | static Lisp_Object |
| 6574 | android_vfs_convert_name (const char *name, Lisp_Object coding) | 6573 | android_vfs_convert_name (const char *name, Lisp_Object coding) |
| 6575 | { | 6574 | { |
| 6576 | Lisp_Object src_coding, name1; | 6575 | Lisp_Object name1; |
| 6577 | |||
| 6578 | src_coding = Qutf_8_emacs; | ||
| 6579 | 6576 | ||
| 6580 | /* Convert the contents of the buffer after BUFFER_END | 6577 | /* Convert the contents of the buffer after BUFFER_END from the file |
| 6581 | from the file name coding system to | 6578 | name coding system to special->special_coding_system. */ |
| 6582 | special->special_coding_system. */ | 6579 | name1 = build_string (name); |
| 6583 | AUTO_STRING (file_name, name); | ||
| 6584 | name1 = code_convert_string_norecord (file_name, src_coding, false); | ||
| 6585 | name1 = code_convert_string (name1, coding, Qt, true, true, true); | 6580 | name1 = code_convert_string (name1, coding, Qt, true, true, true); |
| 6586 | return name1; | 6581 | return name1; |
| 6587 | } | 6582 | } |
| @@ -6632,7 +6627,7 @@ android_root_name (struct android_vnode *vnode, char *name, | |||
| 6632 | 6627 | ||
| 6633 | /* Allocate a buffer and copy file_name into the same. */ | 6628 | /* Allocate a buffer and copy file_name into the same. */ |
| 6634 | length = SBYTES (file_name) + 1; | 6629 | length = SBYTES (file_name) + 1; |
| 6635 | name = SAFE_ALLOCA (length + 1); | 6630 | name = SAFE_ALLOCA (length); |
| 6636 | 6631 | ||
| 6637 | /* Copy the trailing NULL byte also. */ | 6632 | /* Copy the trailing NULL byte also. */ |
| 6638 | memcpy (name, SDATA (file_name), length); | 6633 | memcpy (name, SDATA (file_name), length); |
| @@ -6662,7 +6657,7 @@ android_root_name (struct android_vnode *vnode, char *name, | |||
| 6662 | 6657 | ||
| 6663 | /* Allocate a buffer and copy file_name into the same. */ | 6658 | /* Allocate a buffer and copy file_name into the same. */ |
| 6664 | length = SBYTES (file_name) + 1; | 6659 | length = SBYTES (file_name) + 1; |
| 6665 | name = SAFE_ALLOCA (length + 1); | 6660 | name = SAFE_ALLOCA (length); |
| 6666 | 6661 | ||
| 6667 | /* Copy the trailing NULL byte also. */ | 6662 | /* Copy the trailing NULL byte also. */ |
| 6668 | memcpy (name, SDATA (file_name), length); | 6663 | memcpy (name, SDATA (file_name), length); |