summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
91c5d98)
- string_copy(opt_encoding, arg);
+ string_ncopy(opt_encoding, arg, strlen(arg));
static bool
begin_update(struct view *view)
{
static bool
begin_update(struct view *view)
{
- const char *id = view->id;
-
if (view->pipe)
end_update(view);
if (view->pipe)
end_update(view);
else if (sq_quote(path, 0, opt_path) >= sizeof(path))
return FALSE;
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;
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;
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. */
* 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. */
}
/* Special case for the pager view. */
view->offset = 0;
view->lines = 0;
view->lineno = 0;
view->offset = 0;
view->lines = 0;
view->lineno = 0;
- string_copy_rev(view->vid, id);
+ string_copy_rev(view->vid, view->id);
return;
if (graph->size < SIZEOF_REVITEMS) {
return;
if (graph->size < SIZEOF_REVITEMS) {
- string_ncopy(graph->rev[graph->size++], parent, SIZEOF_REV);
+ string_copy_rev(graph->rev[graph->size++], parent);
- string_copy(commit->author, ident);
+ string_ncopy(commit->author, ident, strlen(ident));
/* Parse epoch and timezone */
if (emailend[1] == ' ') {
/* Parse epoch and timezone */
if (emailend[1] == ' ') {
/* FIXME: More graceful handling of titles; append "..." to
* shortened titles, etc. */
/* FIXME: More graceful handling of titles; append "..." to
* shortened titles, etc. */
- string_copy(commit->title, line);
+ string_ncopy(commit->title, line, strlen(line));
read_repo_config_option(char *name, int namelen, char *value, int valuelen)
{
if (!strcmp(name, "i18n.commitencoding"))
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);
read_repo_info(char *name, int namelen, char *value, int valuelen)
{
if (!opt_cdup[0])
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);
signal(SIGINT, quit);
if (setlocale(LC_ALL, "")) {
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
}
if (load_options() == ERR)
die("Failed to load user config.");
/* Load the repo config file so options can be overwritten from
if (load_repo_config() == ERR)
die("Failed to load repo config.");
if (load_repo_config() == ERR)
die("Failed to load repo config.");
char *search = read_prompt(prompt);
if (search)
char *search = read_prompt(prompt);
if (search)
- string_copy(opt_search, search);
+ string_ncopy(opt_search, search, strlen(search));
else
request = REQ_NONE;
break;
else
request = REQ_NONE;
break;