提交 943316e9 编写于 作者: K Kristian Høgsberg 提交者: Junio C Hamano

Export launch_editor() and make it accept ':' as a no-op editor.

Signed-off-by: NKristian Høgsberg <krh@redhat.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 d63c2fd1
......@@ -17,7 +17,7 @@ static const char builtin_tag_usage[] =
static char signingkey[1000];
static void launch_editor(const char *path, struct strbuf *buffer)
void launch_editor(const char *path, struct strbuf *buffer)
{
const char *editor, *terminal;
struct child_process child;
......@@ -42,6 +42,9 @@ static void launch_editor(const char *path, struct strbuf *buffer)
if (!editor)
editor = "vi";
if (!strcmp(editor, ":"))
return;
memset(&child, 0, sizeof(child));
child.argv = args;
args[0] = editor;
......
......@@ -117,5 +117,6 @@ extern int strbuf_read_file(struct strbuf *sb, const char *path, size_t hint);
extern int strbuf_getline(struct strbuf *, FILE *, int);
extern void stripspace(struct strbuf *buf, int skip_comments);
extern void launch_editor(const char *path, struct strbuf *buffer);
#endif /* STRBUF_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册