diff options
Diffstat (limited to 'ui-shared.c')
| -rw-r--r-- | ui-shared.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ui-shared.c b/ui-shared.c index 1a28dce..af5310b 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
| @@ -103,20 +103,20 @@ const char *cgit_repobasename(const char *reponame) | |||
| 103 | int p; | 103 | int p; |
| 104 | const char *rv; | 104 | const char *rv; |
| 105 | strncpy(rvbuf, reponame, sizeof(rvbuf)); | 105 | strncpy(rvbuf, reponame, sizeof(rvbuf)); |
| 106 | if(rvbuf[sizeof(rvbuf)-1]) | 106 | if (rvbuf[sizeof(rvbuf)-1]) |
| 107 | die("cgit_repobasename: truncated repository name '%s'", reponame); | 107 | die("cgit_repobasename: truncated repository name '%s'", reponame); |
| 108 | p = strlen(rvbuf)-1; | 108 | p = strlen(rvbuf)-1; |
| 109 | /* strip trailing slashes */ | 109 | /* strip trailing slashes */ |
| 110 | while(p && rvbuf[p] == '/') rvbuf[p--] = 0; | 110 | while (p && rvbuf[p] == '/') rvbuf[p--] = 0; |
| 111 | /* strip trailing .git */ | 111 | /* strip trailing .git */ |
| 112 | if(p >= 3 && !strncmp(&rvbuf[p-3], ".git", 4)) { | 112 | if (p >= 3 && !strncmp(&rvbuf[p-3], ".git", 4)) { |
| 113 | p -= 3; rvbuf[p--] = 0; | 113 | p -= 3; rvbuf[p--] = 0; |
| 114 | } | 114 | } |
| 115 | /* strip more trailing slashes if any */ | 115 | /* strip more trailing slashes if any */ |
| 116 | while( p && rvbuf[p] == '/') rvbuf[p--] = 0; | 116 | while ( p && rvbuf[p] == '/') rvbuf[p--] = 0; |
| 117 | /* find last slash in the remaining string */ | 117 | /* find last slash in the remaining string */ |
| 118 | rv = strrchr(rvbuf,'/'); | 118 | rv = strrchr(rvbuf,'/'); |
| 119 | if(rv) | 119 | if (rv) |
| 120 | return ++rv; | 120 | return ++rv; |
| 121 | return rvbuf; | 121 | return rvbuf; |
| 122 | } | 122 | } |
| @@ -576,7 +576,7 @@ void cgit_print_date(time_t secs, const char *format, int local_time) | |||
| 576 | 576 | ||
| 577 | if (!secs) | 577 | if (!secs) |
| 578 | return; | 578 | return; |
| 579 | if(local_time) | 579 | if (local_time) |
| 580 | time = localtime(&secs); | 580 | time = localtime(&secs); |
| 581 | else | 581 | else |
| 582 | time = gmtime(&secs); | 582 | time = gmtime(&secs); |
