fixed
This commit is contained in:
parent
d0844c7fd6
commit
ec9f656358
1 changed files with 7 additions and 12 deletions
19
img.c
19
img.c
|
@ -12,14 +12,10 @@
|
|||
|
||||
struct DB_STR {
|
||||
char *filename;
|
||||
char *desc;
|
||||
|
||||
struct stat stat;
|
||||
char stat_filled;
|
||||
|
||||
char **tags;
|
||||
size_t size;
|
||||
|
||||
char *desc;
|
||||
time_t birthtime;
|
||||
struct DB_STR *next;
|
||||
};
|
||||
|
||||
|
@ -233,12 +229,11 @@ struct DB_STR *new_db_value(char *str) {
|
|||
char new_path[PATH_MAX + 1];
|
||||
snprintf(new_path, sizeof(new_path) - 1, "%s/%s", ROOT, db->filename);
|
||||
|
||||
if (stat(new_path, &db->stat) < 0)
|
||||
struct stat sb;
|
||||
if (stat(new_path, &sb) < 0)
|
||||
fprintf(stderr, "8img: stat: %s: %s\n", db->filename, strerror(errno));
|
||||
|
||||
else
|
||||
db->stat_filled = 1;
|
||||
|
||||
db->birthtime = sb.st_mtime;
|
||||
return db;
|
||||
|
||||
NDV_CLOSE:
|
||||
|
@ -327,7 +322,7 @@ struct DB_STR *build_html_page(FILE *fp, const char *file, const struct UNIQ_TAG
|
|||
}
|
||||
}
|
||||
|
||||
fprintf(fp, "<a href='%s'>\n<img src='%s' alt='%s'></a><br>\n%s<br>\n", p->filename, p->filename, p->filename, GetDate(p->stat.st_ctime));
|
||||
fprintf(fp, "<a href='%s'>\n<img src='%s' alt='%s'></a><br>\n%s<br>\n", p->filename, p->filename, p->filename, GetDate(p->birthtime));
|
||||
for (size_t i = 0; i < p->size; i++)
|
||||
fprintf(fp, " • <a href='%s.html'>%s</a>", p->tags[i], p->tags[i]);
|
||||
|
||||
|
@ -444,7 +439,7 @@ void build_xml(const char *file, struct DB_STR *db) {
|
|||
p->filename,
|
||||
LINK, CHECK_URL(LINK), p->filename,
|
||||
LINK, CHECK_URL(LINK), p->filename,
|
||||
GetDate(p->stat.st_ctime),
|
||||
GetDate(p->birthtime),
|
||||
LINK, CHECK_URL(LINK), p->filename);
|
||||
|
||||
/* Tags */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue