зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1308094 - Remove deprecated PL_strdup calls from toolkit code r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D122148
This commit is contained in:
Родитель
7b783556f9
Коммит
79898e04ea
|
@ -382,7 +382,7 @@ nsCommandLine::Init(int32_t argc, const char* const* argv, nsIFile* aWorkingDir,
|
|||
#endif
|
||||
#if defined(XP_WIN)
|
||||
if (*curarg == '/') {
|
||||
char* dup = PL_strdup(curarg);
|
||||
char* dup = strdup(curarg);
|
||||
if (!dup) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
*dup = '-';
|
||||
|
@ -394,14 +394,14 @@ nsCommandLine::Init(int32_t argc, const char* const* argv, nsIFile* aWorkingDir,
|
|||
} else {
|
||||
appendArg(dup);
|
||||
}
|
||||
PL_strfree(dup);
|
||||
free(dup);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if (*curarg == '-') {
|
||||
if (*(curarg + 1) == '-') ++curarg;
|
||||
|
||||
char* dup = PL_strdup(curarg);
|
||||
char* dup = strdup(curarg);
|
||||
if (!dup) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
char* eq = PL_strchr(dup, '=');
|
||||
|
@ -412,7 +412,7 @@ nsCommandLine::Init(int32_t argc, const char* const* argv, nsIFile* aWorkingDir,
|
|||
} else {
|
||||
appendArg(dup);
|
||||
}
|
||||
PL_strfree(dup);
|
||||
free(dup);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
# include "prthread.h"
|
||||
# include "plstr.h"
|
||||
# include "prenv.h"
|
||||
# include "nsDebug.h"
|
||||
# include "nsXULAppAPI.h"
|
||||
|
@ -231,9 +230,11 @@ static void fpehandler(int signum, siginfo_t* si, void* context) {
|
|||
|
||||
void InstallSignalHandlers(const char* aProgname) {
|
||||
# if defined(CRAWL_STACK_ON_SIGSEGV)
|
||||
const char* tmp = PL_strdup(aProgname);
|
||||
if (tmp) {
|
||||
gProgname = tmp;
|
||||
if (aProgname) {
|
||||
const char* tmp = strdup(aProgname);
|
||||
if (tmp) {
|
||||
gProgname = tmp;
|
||||
}
|
||||
}
|
||||
# endif // CRAWL_STACK_ON_SIGSEGV
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче