From 5c5ddc926b20fae71544a8f2e2d96f15e1546c71 Mon Sep 17 00:00:00 2001 From: yzrh Date: Tue, 29 Dec 2020 02:10:17 +0000 Subject: Update HN data structure. --- src/melon.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/melon.c') 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 \n\n"); - cnki_t *param = NULL; if (cnki_create(¶m) != 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 \n\n"); + cnki_info(¶m); 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(¶m) != 0) { + if (cnki_hn(¶m) != 0) { fprintf(stderr, "%s: %s\n", argv[0], strerror(errno)); return EXIT_FAILURE; -- cgit v1.2.3