aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2024-04-21 21:11:22 +0800
committerPo Lu2024-04-21 21:11:22 +0800
commit4773ecb93193495f141e5d60c0c5ded58eaa2c98 (patch)
treed9e2401c2ada487ff2f23d861abb962945302bf4 /src
parent9c01da56a547f493535e73877e16ccefcb2730a0 (diff)
downloademacs-4773ecb93193495f141e5d60c0c5ded58eaa2c98.tar.gz
emacs-4773ecb93193495f141e5d60c0c5ded58eaa2c98.zip
Better verify arguments to android-relinquish-directory-access
* src/androidvfs.c (Fandroid_relinquish_directory_access): Provide for NULL values from android_name_file and remote files. * src/xdisp.c (decode_mode_spec): Don't intern file-remote-p. (syms_of_xdisp) <Qfile_remote_p>: New defsym.
Diffstat (limited to 'src')
-rw-r--r--src/androidvfs.c17
-rw-r--r--src/xdisp.c5
2 files changed, 16 insertions, 6 deletions
diff --git a/src/androidvfs.c b/src/androidvfs.c
index 9e65dd2b140..c4b3dba4af0 100644
--- a/src/androidvfs.c
+++ b/src/androidvfs.c
@@ -7805,10 +7805,10 @@ DEFUN ("android-relinquish-directory-access",
7805 Sandroid_relinquish_directory_access, 1, 1, 7805 Sandroid_relinquish_directory_access, 1, 1,
7806 "DDirectory: ", 7806 "DDirectory: ",
7807 doc: /* Relinquish access to the provided directory. 7807 doc: /* Relinquish access to the provided directory.
7808DIRECTORY must be an inferior directory to a subdirectory of 7808DIRECTORY must be the toplevel directory of an open SAF volume (i.e., a
7809/content/storage. Once the command completes, the parent of DIRECTORY 7809file under /content/storage), or one of its inferiors. Once the command
7810below that subdirectory from will cease to appear there, but no files 7810completes, the SAF directory holding this directory will vanish, but no
7811will be removed. */) 7811files will be removed. */)
7812 (Lisp_Object file) 7812 (Lisp_Object file)
7813{ 7813{
7814 struct android_vnode *vp; 7814 struct android_vnode *vp;
@@ -7824,7 +7824,14 @@ will be removed. */)
7824 return Qnil; 7824 return Qnil;
7825 7825
7826 file = ENCODE_FILE (Fexpand_file_name (file, Qnil)); 7826 file = ENCODE_FILE (Fexpand_file_name (file, Qnil));
7827 vp = android_name_file (SSDATA (file)); 7827
7828 if (!NILP (call1 (Qfile_remote_p, file)))
7829 signal_error ("Cannot relinquish access to remote file", file);
7830
7831 vp = android_name_file (SSDATA (file));
7832
7833 if (!vp)
7834 report_file_error ("Relinquishing directory", file);
7828 7835
7829 if (vp->type != ANDROID_VNODE_SAF_TREE) 7836 if (vp->type != ANDROID_VNODE_SAF_TREE)
7830 { 7837 {
diff --git a/src/xdisp.c b/src/xdisp.c
index 5fe16ab9536..72a217513ef 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -28860,7 +28860,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
28860 Lisp_Object val = Qnil; 28860 Lisp_Object val = Qnil;
28861 28861
28862 if (STRINGP (curdir)) 28862 if (STRINGP (curdir))
28863 val = dsafe_call1 (intern ("file-remote-p"), curdir); 28863 val = dsafe_call1 (Qfile_remote_p, curdir);
28864 28864
28865 val = unbind_to (count, val); 28865 val = unbind_to (count, val);
28866 28866
@@ -38257,6 +38257,9 @@ The default value is zero, which disables this feature.
38257The recommended non-zero value is between 100000 and 1000000, 38257The recommended non-zero value is between 100000 and 1000000,
38258depending on your patience and the speed of your system. */); 38258depending on your patience and the speed of your system. */);
38259 max_redisplay_ticks = 0; 38259 max_redisplay_ticks = 0;
38260
38261 /* Called by decode_mode_spec. */
38262 DEFSYM (Qfile_remote_p, "file-remote-p");
38260} 38263}
38261 38264
38262 38265