summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 012e76e)
raw | patch | inline | side by side (parent: 012e76e)
author | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 20 Mar 2008 00:53:36 +0000 (01:53 +0100) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 20 Mar 2008 11:38:50 +0000 (12:38 +0100) |
tig.c | patch | blob | history |
index 25cf31b02e18ea71de4e7fcc30b1568429f7e801..756ce47429abe83f70ed5ea21d1fd1f0f5721a38 100644 (file)
--- a/tig.c
+++ b/tig.c
draw_text(struct view *view, const char *string, int max_len, int col,
bool use_tilde, int tilde_attr)
{
- int n;
+ int len = 0;
- n = 0;
if (max_len > 0) {
- int len;
int trimmed = FALSE;
if (opt_utf8) {
len = utf8_length(string, max_len, &trimmed, use_tilde);
- n = len;
} else {
len = strlen(string);
if (len > max_len) {
len = max_len;
trimmed = TRUE;
}
- n = len;
}
- waddnstr(view->win, string, n);
+ waddnstr(view->win, string, len);
if (trimmed && use_tilde) {
if (tilde_attr != -1)
wattrset(view->win, tilde_attr);
waddch(view->win, '~');
- n++;
+ len++;
}
}
- return n;
+ return len;
}
static bool