aboutsummaryrefslogtreecommitdiffstats
path: root/src/melon.c
diff options
context:
space:
mode:
authoryzrh <yzrh@noema.org>2020-12-30 03:09:00 +0000
committeryzrh <yzrh@noema.org>2020-12-30 03:09:00 +0000
commit98691d4203f4e578b84b2014db0fbe0c1209cc48 (patch)
treec528e3ea964111b934ae5e61e847831d62944f41 /src/melon.c
parent8d6fbb43c9bc840d4217bf4f0b49b1213f1601a1 (diff)
downloadmelon-98691d4203f4e578b84b2014db0fbe0c1209cc48.tar.gz
melon-98691d4203f4e578b84b2014db0fbe0c1209cc48.tar.zst
Add HN text extraction.
Diffstat (limited to 'src/melon.c')
-rw-r--r--src/melon.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/melon.c b/src/melon.c
index 62b742d..375cf09 100644
--- a/src/melon.c
+++ b/src/melon.c
@@ -86,25 +86,25 @@ main(int argc, char **argv, char **envp)
cnki_info(&param);
- if (strcmp(param->file_stat->type, "%PDF") == 0) {
+ if (strncmp(param->file_stat->type, "%PDF", 4) == 0) {
if (cnki_pdf(&param) != 0) {
fprintf(stderr, "%s: %s\n", argv[0],
strerror(errno));
return EXIT_FAILURE;
}
- } else if (strcmp(param->file_stat->type, "CAJ") == 0) {
+ } else if (strncmp(param->file_stat->type, "CAJ", 3) == 0) {
if (cnki_caj(&param) != 0) {
fprintf(stderr, "%s: %s\n", argv[0],
strerror(errno));
return EXIT_FAILURE;
}
- } else if (strcmp(param->file_stat->type, "HN") == 0) {
+ } else if (strncmp(param->file_stat->type, "HN", 2) == 0) {
if (cnki_hn(&param) != 0) {
fprintf(stderr, "%s: %s\n", argv[0],
strerror(errno));
return EXIT_FAILURE;
}
- } else if (strcmp(param->file_stat->type, "KDH ") == 0) {
+ } else if (strncmp(param->file_stat->type, "KDH ", 4) == 0) {
if (cnki_kdh(&param) != 0) {
fprintf(stderr, "%s: %s\n", argv[0],
strerror(errno));