From: James Bowes <jbowes@dangerouslyinc.com>
To: git@vger.kernel.org
Cc: junkio@cox.net
Subject: [PATCH] Replace remaining instances of strdup with xstrdup.
Date: Mon, 19 Mar 2007 17:42:40 -0400 [thread overview]
Message-ID: <1174340560341-git-send-email-jbowes@dangerouslyinc.com> (raw)
Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
---
This is a blatant copy of Shawn's patch. I don't know if there's a reason these
are still strdup. If there is, please ignore this patch :)
builtin-log.c | 2 +-
commit.c | 2 +-
revision.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin-log.c b/builtin-log.c
index 865832c..71df957 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -35,7 +35,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
if (!prefixcmp(arg, "--encoding=")) {
arg += 11;
if (strcmp(arg, "none"))
- git_log_output_encoding = strdup(arg);
+ git_log_output_encoding = xstrdup(arg);
else
git_log_output_encoding = "";
}
diff --git a/commit.c b/commit.c
index 5b9234e..718e568 100644
--- a/commit.c
+++ b/commit.c
@@ -706,7 +706,7 @@ static char *logmsg_reencode(const struct commit *commit,
encoding = get_header(commit, "encoding");
use_encoding = encoding ? encoding : utf8;
if (!strcmp(use_encoding, output_encoding))
- out = strdup(commit->buffer);
+ out = xstrdup(commit->buffer);
else
out = reencode_string(commit->buffer,
output_encoding, use_encoding);
diff --git a/revision.c b/revision.c
index bcdb6a1..c680dcb 100644
--- a/revision.c
+++ b/revision.c
@@ -1038,7 +1038,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
if (!prefixcmp(arg, "--encoding=")) {
arg += 11;
if (strcmp(arg, "none"))
- git_log_output_encoding = strdup(arg);
+ git_log_output_encoding = xstrdup(arg);
else
git_log_output_encoding = "";
continue;
--
1.5.1.rc1.1.g504b
reply other threads:[~2007-03-19 21:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1174340560341-git-send-email-jbowes@dangerouslyinc.com \
--to=jbowes@dangerouslyinc.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).