author | Lars Hjemli <hjemli@gmail.com> | 2007-06-17 10:58:59 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-06-17 10:58:59 (UTC) |
commit | 486c87ec2906c445ca505c877720d56e02aed784 (patch) (unidiff) | |
tree | 42d66dc8e9dfee4812f3f37b7bc8deef04d4e78d | |
parent | 44947bfcdc0d6e8c7d673bea0538cbf2a182f289 (diff) | |
download | cgit-486c87ec2906c445ca505c877720d56e02aed784.zip cgit-486c87ec2906c445ca505c877720d56e02aed784.tar.gz cgit-486c87ec2906c445ca505c877720d56e02aed784.tar.bz2 |
ui-shared: use strcmp() to compare strings
Somehow a couple of pointer comparisions crept into the new repolink()
and cgit_tree_link() functions. Fix it.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-shared.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ui-shared.c b/ui-shared.c index 9ab6409..657e8af 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -122,32 +122,32 @@ static char *repolink(char *title, char *class, char *page, char *head, | |||
122 | if (cgit_repo->url[strlen(cgit_repo->url) - 1] != '/') | 122 | if (cgit_repo->url[strlen(cgit_repo->url) - 1] != '/') |
123 | html("/"); | 123 | html("/"); |
124 | html(page); | 124 | html(page); |
125 | html("/"); | 125 | html("/"); |
126 | if (path) | 126 | if (path) |
127 | html_attr(path); | 127 | html_attr(path); |
128 | delim = "&"; | 128 | delim = "&"; |
129 | } | 129 | } |
130 | if (head && head != cgit_query_head) { | 130 | if (head && strcmp(head, cgit_query_head)) { |
131 | html(delim); | 131 | html(delim); |
132 | html("h="); | 132 | html("h="); |
133 | html_attr(head); | 133 | html_attr(head); |
134 | delim = "&"; | 134 | delim = "&"; |
135 | } | 135 | } |
136 | return fmt("%s", delim); | 136 | return fmt("%s", delim); |
137 | } | 137 | } |
138 | 138 | ||
139 | void cgit_tree_link(char *name, char *title, char *class, char *head, | 139 | void cgit_tree_link(char *name, char *title, char *class, char *head, |
140 | char *rev, char *path) | 140 | char *rev, char *path) |
141 | { | 141 | { |
142 | char *delim; | 142 | char *delim; |
143 | 143 | ||
144 | delim = repolink(title, class, "tree", head, path); | 144 | delim = repolink(title, class, "tree", head, path); |
145 | if (rev && rev != cgit_query_head) { | 145 | if (rev && strcmp(rev, cgit_query_head)) { |
146 | html(delim); | 146 | html(delim); |
147 | html("id="); | 147 | html("id="); |
148 | html_attr(rev); | 148 | html_attr(rev); |
149 | } | 149 | } |
150 | html("'>"); | 150 | html("'>"); |
151 | html_txt(name); | 151 | html_txt(name); |
152 | html("</a>"); | 152 | html("</a>"); |
153 | } | 153 | } |