diff options
| author | Eli Zaretskii | 2014-12-26 11:52:24 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2014-12-26 11:52:24 +0200 |
| commit | d65526283d517e0b97b0c74af75bb2e869db4dae (patch) | |
| tree | 824b887fd0e05a1666daee2eae0387f5a1c22749 /src | |
| parent | f76956645ddf3bde4105b50e9bd1e3a1cc2da39c (diff) | |
| download | emacs-d65526283d517e0b97b0c74af75bb2e869db4dae.tar.gz emacs-d65526283d517e0b97b0c74af75bb2e869db4dae.zip | |
MS-Windows followup to stpcpy changes.
src/w32proc.c (sys_spawnve, get_lcid_callback): Use strcpy instead
of strcat.
src/w32menu.c (add_menu_item): Use stpcpy instead of strcat.
src/w32.c (sys_readdir, stat_worker, symlink): Use strcpy instead of
strcat.
nt/gnulib.mk (stpcpy, string): Sync with the latest change in
lib/gnulib.mk.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/w32.c | 13 | ||||
| -rw-r--r-- | src/w32menu.c | 6 | ||||
| -rw-r--r-- | src/w32proc.c | 15 |
4 files changed, 26 insertions, 18 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index f3bc9fd2c87..72601fe7c58 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2014-12-26 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * w32proc.c (sys_spawnve, get_lcid_callback): Use strcpy instead | ||
| 4 | of strcat. | ||
| 5 | |||
| 6 | * w32menu.c (add_menu_item): Use stpcpy instead of strcat. | ||
| 7 | |||
| 8 | * w32.c (sys_readdir, stat_worker, symlink): Use strcpy instead of | ||
| 9 | strcat. | ||
| 10 | |||
| 1 | 2014-12-26 Paul Eggert <eggert@cs.ucla.edu> | 11 | 2014-12-26 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 12 | ||
| 3 | Use bool for boolean in xsmfns.c | 13 | Use bool for boolean in xsmfns.c |
| @@ -3405,10 +3405,10 @@ sys_readdir (DIR *dirp) | |||
| 3405 | int ln; | 3405 | int ln; |
| 3406 | 3406 | ||
| 3407 | strcpy (filename, dir_pathname); | 3407 | strcpy (filename, dir_pathname); |
| 3408 | ln = strlen (filename) - 1; | 3408 | ln = strlen (filename); |
| 3409 | if (!IS_DIRECTORY_SEP (filename[ln])) | 3409 | if (!IS_DIRECTORY_SEP (filename[ln - 1])) |
| 3410 | strcat (filename, "\\"); | 3410 | filename[ln++] = '\\'; |
| 3411 | strcat (filename, "*"); | 3411 | strcpy (filename + ln, "*"); |
| 3412 | 3412 | ||
| 3413 | /* Note: No need to resolve symlinks in FILENAME, because | 3413 | /* Note: No need to resolve symlinks in FILENAME, because |
| 3414 | FindFirst opens the directory that is the target of a | 3414 | FindFirst opens the directory that is the target of a |
| @@ -4969,7 +4969,7 @@ stat_worker (const char * path, struct stat * buf, int follow_symlinks) | |||
| 4969 | { | 4969 | { |
| 4970 | /* Make sure root directories end in a slash. */ | 4970 | /* Make sure root directories end in a slash. */ |
| 4971 | if (!IS_DIRECTORY_SEP (name[len-1])) | 4971 | if (!IS_DIRECTORY_SEP (name[len-1])) |
| 4972 | strcat (name, "\\"); | 4972 | strcpy (name + len, "\\"); |
| 4973 | if (GetDriveType (name) < 2) | 4973 | if (GetDriveType (name) < 2) |
| 4974 | { | 4974 | { |
| 4975 | errno = ENOENT; | 4975 | errno = ENOENT; |
| @@ -5438,8 +5438,7 @@ symlink (char const *filename, char const *linkname) | |||
| 5438 | p--; | 5438 | p--; |
| 5439 | if (p > linkfn) | 5439 | if (p > linkfn) |
| 5440 | strncpy (tem, linkfn, p - linkfn); | 5440 | strncpy (tem, linkfn, p - linkfn); |
| 5441 | tem[p - linkfn] = '\0'; | 5441 | strcpy (tem + (p - linkfn), filename); |
| 5442 | strcat (tem, filename); | ||
| 5443 | dir_access = faccessat (AT_FDCWD, tem, D_OK, AT_EACCESS); | 5442 | dir_access = faccessat (AT_FDCWD, tem, D_OK, AT_EACCESS); |
| 5444 | } | 5443 | } |
| 5445 | else | 5444 | else |
diff --git a/src/w32menu.c b/src/w32menu.c index 6633ffddbcf..287062c702c 100644 --- a/src/w32menu.c +++ b/src/w32menu.c | |||
| @@ -1256,9 +1256,9 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item) | |||
| 1256 | if (wv->key != NULL) | 1256 | if (wv->key != NULL) |
| 1257 | { | 1257 | { |
| 1258 | out_string = SAFE_ALLOCA (strlen (wv->name) + strlen (wv->key) + 2); | 1258 | out_string = SAFE_ALLOCA (strlen (wv->name) + strlen (wv->key) + 2); |
| 1259 | strcpy (out_string, wv->name); | 1259 | p = stpcpy (out_string, wv->name); |
| 1260 | strcat (out_string, "\t"); | 1260 | p = stpcpy (p, "\t"); |
| 1261 | strcat (out_string, wv->key); | 1261 | strcpy (p, wv->key); |
| 1262 | } | 1262 | } |
| 1263 | else | 1263 | else |
| 1264 | out_string = (char *)wv->name; | 1264 | out_string = (char *)wv->name; |
diff --git a/src/w32proc.c b/src/w32proc.c index 09e0c0530a4..c571726d70f 100644 --- a/src/w32proc.c +++ b/src/w32proc.c | |||
| @@ -1665,10 +1665,7 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp) | |||
| 1665 | if (egetenv ("CMDPROXY")) | 1665 | if (egetenv ("CMDPROXY")) |
| 1666 | strcpy (cmdname, egetenv ("CMDPROXY")); | 1666 | strcpy (cmdname, egetenv ("CMDPROXY")); |
| 1667 | else | 1667 | else |
| 1668 | { | 1668 | strcpy (lispstpcpy (cmdname, Vinvocation_directory), "cmdproxy.exe"); |
| 1669 | lispstpcpy (cmdname, Vinvocation_directory); | ||
| 1670 | strcat (cmdname, "cmdproxy.exe"); | ||
| 1671 | } | ||
| 1672 | 1669 | ||
| 1673 | /* Can't use unixtodos_filename here, since that needs its file | 1670 | /* Can't use unixtodos_filename here, since that needs its file |
| 1674 | name argument encoded in UTF-8. */ | 1671 | name argument encoded in UTF-8. */ |
| @@ -3183,18 +3180,20 @@ get_lcid_callback (LPTSTR locale_num_str) | |||
| 3183 | if (GetLocaleInfo (try_lcid, LOCALE_SABBREVLANGNAME, | 3180 | if (GetLocaleInfo (try_lcid, LOCALE_SABBREVLANGNAME, |
| 3184 | locval, LOCALE_NAME_MAX_LENGTH)) | 3181 | locval, LOCALE_NAME_MAX_LENGTH)) |
| 3185 | { | 3182 | { |
| 3183 | size_t locval_len; | ||
| 3184 | |||
| 3186 | /* This is for when they only specify the language, as in "ENU". */ | 3185 | /* This is for when they only specify the language, as in "ENU". */ |
| 3187 | if (stricmp (locval, lname) == 0) | 3186 | if (stricmp (locval, lname) == 0) |
| 3188 | { | 3187 | { |
| 3189 | found_lcid = try_lcid; | 3188 | found_lcid = try_lcid; |
| 3190 | return FALSE; | 3189 | return FALSE; |
| 3191 | } | 3190 | } |
| 3192 | strcat (locval, "_"); | 3191 | locval_len = strlen (locval); |
| 3192 | strcpy (locval + locval_len, "_"); | ||
| 3193 | if (GetLocaleInfo (try_lcid, LOCALE_SABBREVCTRYNAME, | 3193 | if (GetLocaleInfo (try_lcid, LOCALE_SABBREVCTRYNAME, |
| 3194 | locval + strlen (locval), LOCALE_NAME_MAX_LENGTH)) | 3194 | locval + locval_len + 1, LOCALE_NAME_MAX_LENGTH)) |
| 3195 | { | 3195 | { |
| 3196 | size_t locval_len = strlen (locval); | 3196 | locval_len = strlen (locval); |
| 3197 | |||
| 3198 | if (strnicmp (locval, lname, locval_len) == 0 | 3197 | if (strnicmp (locval, lname, locval_len) == 0 |
| 3199 | && (lname[locval_len] == '.' | 3198 | && (lname[locval_len] == '.' |
| 3200 | || lname[locval_len] == '\0')) | 3199 | || lname[locval_len] == '\0')) |