aboutsummaryrefslogtreecommitdiffstats
path: root/src/melon.c
diff options
context:
space:
mode:
authoryzrh <yzrh@noema.org>2020-12-29 02:10:17 +0000
committeryzrh <yzrh@noema.org>2020-12-29 02:10:17 +0000
commit5c5ddc926b20fae71544a8f2e2d96f15e1546c71 (patch)
treea6144bf5f9f2e45085d125e9c11575a6855821a6 /src/melon.c
parentbcb8ef9cd96738da8474e70c03c1f2a3bdf9053a (diff)
downloadmelon-5c5ddc926b20fae71544a8f2e2d96f15e1546c71.tar.gz
melon-5c5ddc926b20fae71544a8f2e2d96f15e1546c71.tar.zst
Update HN data structure.
Diffstat (limited to 'src/melon.c')
-rw-r--r--src/melon.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/melon.c b/src/melon.c
index cba0217..62b742d 100644
--- a/src/melon.c
+++ b/src/melon.c
@@ -16,9 +16,6 @@
int
main(int argc, char **argv, char **envp)
{
- printf("Melon " VERSION "." RELEASE "." PATCH EXTRA "\n");
- printf("Copyright (c) 2020, yzrh <yzrh@noema.org>\n\n");
-
cnki_t *param = NULL;
if (cnki_create(&param) != 0) {
@@ -83,6 +80,10 @@ main(int argc, char **argv, char **envp)
return EXIT_FAILURE;
}
+ if (param->stat > 0)
+ printf("Melon " VERSION "." RELEASE "." PATCH EXTRA "\n"
+ "Copyright (c) 2020, yzrh <yzrh@noema.org>\n\n");
+
cnki_info(&param);
if (strcmp(param->file_stat->type, "%PDF") == 0) {
@@ -98,7 +99,7 @@ main(int argc, char **argv, char **envp)
return EXIT_FAILURE;
}
} else if (strcmp(param->file_stat->type, "HN") == 0) {
- if (cnki_nh(&param) != 0) {
+ if (cnki_hn(&param) != 0) {
fprintf(stderr, "%s: %s\n", argv[0],
strerror(errno));
return EXIT_FAILURE;