diff options
| author | Po Lu | 2023-09-02 09:28:50 +0800 |
|---|---|---|
| committer | Po Lu | 2023-09-02 09:30:05 +0800 |
| commit | dc1ed3dbfa012a44d65a87d22f510a71474d8123 (patch) | |
| tree | 96aa3c38aa5e42bc6a23ef94e22a865d2e198623 /src/android.c | |
| parent | 0346bf419a34a0ef7034483176e54727e796e32a (diff) | |
| download | emacs-dc1ed3dbfa012a44d65a87d22f510a71474d8123.tar.gz emacs-dc1ed3dbfa012a44d65a87d22f510a71474d8123.zip | |
Update Android port
* lisp/touch-screen.el (touch-screen-handle-point-up) <held>:
Treat `held' as `drag' as well.
* src/android.c (android_is_special_directory): Return bool
rather than a pointer to the remainder of the file name, given
that said pointer is never used.
* src/android.h (android_is_special_directory): Modify
correspondingly.
Diffstat (limited to 'src/android.c')
| -rw-r--r-- | src/android.c | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/src/android.c b/src/android.c index 94aeb726fc6..b501a66b25d 100644 --- a/src/android.c +++ b/src/android.c | |||
| @@ -833,22 +833,18 @@ android_user_full_name (struct passwd *pw) | |||
| 833 | return (char *) "Android user"; | 833 | return (char *) "Android user"; |
| 834 | 834 | ||
| 835 | return pw->pw_gecos; | 835 | return pw->pw_gecos; |
| 836 | #else | 836 | #else /* !HAVE_STRUCT_PASSWD_PW_GECOS */ |
| 837 | return "Android user"; | 837 | return "Android user"; |
| 838 | #endif | 838 | #endif /* HAVE_STRUCT_PASSWD_PW_GECOS */ |
| 839 | } | 839 | } |
| 840 | 840 | ||
| 841 | 841 | ||
| 842 | 842 | ||
| 843 | /* Determine whether or not the specified file NAME describes a file | 843 | /* Return whether or not the specified file NAME designates a file in |
| 844 | in the directory DIR, which should be an absolute file name. NAME | 844 | the directory DIR, which should be an absolute file name. NAME |
| 845 | must be in canonical form. | 845 | must be in canonical form. */ |
| 846 | |||
| 847 | Value is NULL if not. Otherwise, it is a pointer to the first | ||
| 848 | character in NAME after the part containing DIR and its trailing | ||
| 849 | directory separator. */ | ||
| 850 | 846 | ||
| 851 | const char * | 847 | bool |
| 852 | android_is_special_directory (const char *name, const char *dir) | 848 | android_is_special_directory (const char *name, const char *dir) |
| 853 | { | 849 | { |
| 854 | size_t len; | 850 | size_t len; |
| @@ -857,7 +853,7 @@ android_is_special_directory (const char *name, const char *dir) | |||
| 857 | 853 | ||
| 858 | len = strlen (dir); | 854 | len = strlen (dir); |
| 859 | if (strncmp (name, dir, len)) | 855 | if (strncmp (name, dir, len)) |
| 860 | return NULL; | 856 | return false; |
| 861 | 857 | ||
| 862 | /* Now see if the character of NAME after len is either a directory | 858 | /* Now see if the character of NAME after len is either a directory |
| 863 | separator or a terminating NULL. */ | 859 | separator or a terminating NULL. */ |
| @@ -865,20 +861,13 @@ android_is_special_directory (const char *name, const char *dir) | |||
| 865 | name += len; | 861 | name += len; |
| 866 | switch (*name) | 862 | switch (*name) |
| 867 | { | 863 | { |
| 868 | case '\0': | 864 | case '\0': /* NAME is an exact match for DIR. */ |
| 869 | /* Return the empty string if this is the end of the file | 865 | case '/': /* NAME is a constituent of DIR. */ |
| 870 | name. */ | 866 | return true; |
| 871 | return name; | ||
| 872 | |||
| 873 | case '/': | ||
| 874 | /* Return NAME (with the separator removed) if it describes a | ||
| 875 | file. */ | ||
| 876 | return name + 1; | ||
| 877 | |||
| 878 | default: | ||
| 879 | /* The file name doesn't match. */ | ||
| 880 | return NULL; | ||
| 881 | } | 867 | } |
| 868 | |||
| 869 | /* The file name doesn't match. */ | ||
| 870 | return false; | ||
| 882 | } | 871 | } |
| 883 | 872 | ||
| 884 | #if 0 | 873 | #if 0 |