summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 91c5d98)
raw | patch | inline | side by side (parent: 91c5d98)
author | Jonas Fonseca <fonseca@diku.dk> | |
Sat, 2 Jun 2007 17:03:30 +0000 (19:03 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Sat, 2 Jun 2007 17:03:30 +0000 (19:03 +0200) |
tig.c | patch | blob | history |
index d6e54b180ef98e51ffd09ed6b299669a33e558b3..5805f587e320e66535e05618119c8e6444c4ba1a 100644 (file)
--- a/tig.c
+++ b/tig.c
break;
}
default:
- string_copy(opt_encoding, arg);
+ string_ncopy(opt_encoding, arg, strlen(arg));
return OK;
}
}
static bool
begin_update(struct view *view)
{
- const char *id = view->id;
-
if (view->pipe)
end_update(view);
else if (sq_quote(path, 0, opt_path) >= sizeof(path))
return FALSE;
- if (!string_format(view->cmd, format, id, path))
+ if (!string_format(view->cmd, format, view->id, path))
return FALSE;
} else {
const char *format = view->cmd_env ? view->cmd_env : view->cmd_fmt;
+ const char *id = view->id;
if (!string_format(view->cmd, format, id, id, id, id, id))
return FALSE;
* member. This is needed by the blob view. Most other
* views sets it automatically after loading because the
* first line is a commit line. */
- string_copy(view->ref, id);
+ string_copy_rev(view->ref, view->id);
}
/* Special case for the pager view. */
view->offset = 0;
view->lines = 0;
view->lineno = 0;
- string_copy_rev(view->vid, id);
+ string_copy_rev(view->vid, view->id);
if (view->line) {
int i;
return;
if (graph->size < SIZEOF_REVITEMS) {
- string_ncopy(graph->rev[graph->size++], parent, SIZEOF_REV);
+ string_copy_rev(graph->rev[graph->size++], parent);
}
}
ident = "Unknown";
}
- string_copy(commit->author, ident);
+ string_ncopy(commit->author, ident, strlen(ident));
/* Parse epoch and timezone */
if (emailend[1] == ' ') {
/* FIXME: More graceful handling of titles; append "..." to
* shortened titles, etc. */
- string_copy(commit->title, line);
+ string_ncopy(commit->title, line, strlen(line));
}
return TRUE;
read_repo_config_option(char *name, int namelen, char *value, int valuelen)
{
if (!strcmp(name, "i18n.commitencoding"))
- string_copy(opt_encoding, value);
+ string_ncopy(opt_encoding, value, valuelen);
return OK;
}
read_repo_info(char *name, int namelen, char *value, int valuelen)
{
if (!opt_cdup[0])
- string_copy(opt_cdup, name);
+ string_ncopy(opt_cdup, name, namelen);
return OK;
}
signal(SIGINT, quit);
if (setlocale(LC_ALL, "")) {
- string_copy(opt_codeset, nl_langinfo(CODESET));
+ char *codeset = nl_langinfo(CODESET);
+
+ string_ncopy(opt_codeset, codeset, strlen(codeset));
}
if (load_options() == ERR)
die("Failed to load user config.");
/* Load the repo config file so options can be overwritten from
- * the command line. */
+ * the command line. */
if (load_repo_config() == ERR)
die("Failed to load repo config.");
char *search = read_prompt(prompt);
if (search)
- string_copy(opt_search, search);
+ string_ncopy(opt_search, search, strlen(search));
else
request = REQ_NONE;
break;