diff options
| author | Po Lu | 2024-03-14 14:21:49 +0800 |
|---|---|---|
| committer | Po Lu | 2024-03-14 14:21:49 +0800 |
| commit | 1b94f800ae34de5f4e72682a81de1d42bdda9276 (patch) | |
| tree | 995b18082db13a1a7e6515195a9086dc12c8fcb0 /exec | |
| parent | 30bc867aecc59265b6e315acf459f8d79c423bca (diff) | |
| download | emacs-1b94f800ae34de5f4e72682a81de1d42bdda9276.tar.gz emacs-1b94f800ae34de5f4e72682a81de1d42bdda9276.zip | |
* exec/trace.c (rpl_stpcpy): Replace stpcpy if absent.
Diffstat (limited to 'exec')
| -rw-r--r-- | exec/trace.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/exec/trace.c b/exec/trace.c index 64dadc092c2..05d862f5b9f 100644 --- a/exec/trace.c +++ b/exec/trace.c | |||
| @@ -895,6 +895,36 @@ handle_exec (struct exec_tracee *tracee, USER_REGS_STRUCT *regs) | |||
| 895 | return 3; | 895 | return 3; |
| 896 | } | 896 | } |
| 897 | 897 | ||
| 898 | |||
| 899 | |||
| 900 | /* Define replacements for required string functions. */ | ||
| 901 | |||
| 902 | #if !defined HAVE_STPCPY || !defined HAVE_DECL_STPCPY | ||
| 903 | |||
| 904 | /* Copy SRC to DEST, returning the address of the terminating '\0' in | ||
| 905 | DEST. */ | ||
| 906 | |||
| 907 | static char * | ||
| 908 | rpl_stpcpy (char *dest, const char *src) | ||
| 909 | { | ||
| 910 | register char *d; | ||
| 911 | register const char *s; | ||
| 912 | |||
| 913 | d = dest; | ||
| 914 | s = src; | ||
| 915 | |||
| 916 | do | ||
| 917 | *d++ = *s; | ||
| 918 | while (*s++ != '\0'); | ||
| 919 | |||
| 920 | return d - 1; | ||
| 921 | } | ||
| 922 | |||
| 923 | #define stpcpy rpl_stpcpy | ||
| 924 | #endif /* !defined HAVE_STPCPY || !defined HAVE_DECL_STPCPY */ | ||
| 925 | |||
| 926 | |||
| 927 | |||
| 898 | /* Modify BUFFER, of size SIZE, so that it holds the absolute name of | 928 | /* Modify BUFFER, of size SIZE, so that it holds the absolute name of |
| 899 | the file identified by BUFFER, relative to the current working | 929 | the file identified by BUFFER, relative to the current working |
| 900 | directory of TRACEE if FD be AT_FDCWD, or the file referenced by FD | 930 | directory of TRACEE if FD be AT_FDCWD, or the file referenced by FD |