1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00

Merge from savannah/emacs-30

e0b271e279 Take precautions against ill-formed content URIs
9331ab056a etags-regen-mode: Handle TAGS buffer being killed
ef3f26ec02 ; Tag ERC multiline blanks test as :expensive
945335fec1 Improve 'put-image' documentation
c38d5cc3b2 Improve 'set-fontset-font' documentation
7de4dbea08 Adapt Tramp's "run0" method
871585db4c * test/src/sqlite-tests.el (sqlite-execute-batch): Declar...
5cf8d60e0d Capitalize "Dired" and "Lisp" in docstrings
37475c9af7 Document Eshell entry points

# Conflicts:
#	etc/NEWS
This commit is contained in:
Po Lu 2024-07-11 11:40:34 +08:00
commit 166685a7d9
23 changed files with 217 additions and 100 deletions

View file

@ -987,6 +987,7 @@ public final class EmacsService extends Service
String name, mode;
ParcelFileDescriptor fd;
int i;
Uri uriObject;
/* Figure out the file access mode. */
@ -1001,12 +1002,20 @@ public final class EmacsService extends Service
if (truncate)
mode += "t";
/* Decode the URI. It might be possible for a perverse user to
construct a content file name that Android finds unparsable, so
punt if the result is NULL. */
uriObject = Uri.parse (uri);
if (uriObject == null)
return -1;
/* Try to open a corresponding ParcelFileDescriptor. Though
`fd.detachFd' is exclusive to Honeycomb and up, this function is
never called on systems older than KitKat, which is Emacs's
minimum requirement for access to /content/by-authority. */
fd = resolver.openFileDescriptor (Uri.parse (uri), mode);
fd = resolver.openFileDescriptor (uriObject, mode);
if (fd == null)
return -1;
@ -1027,7 +1036,14 @@ public final class EmacsService extends Service
Uri uri;
int rc, flags;
/* Decode the URI. It might be possible that perverse user should
construct a content file name that Android finds unparsable, so
punt if the result is NULL. */
uri = Uri.parse (name);
if (uri == null)
return false;
flags = 0;
if (readable)