comparison sidinfo.c @ 212:90ff5dbee152

The HVSC path -H option now requires HVSC root directory, not HVSC/DOCUMENTS directory.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 23 Dec 2018 08:25:21 +0200
parents c073c7eda531
children 65bd23eacdca
comparison
equal deleted inserted replaced
211:ddadc2f3302a 212:90ff5dbee152
131 { 6, 'l', "line", "Output in one line format, -l <field separator>", OPT_ARGREQ }, 131 { 6, 'l', "line", "Output in one line format, -l <field separator>", OPT_ARGREQ },
132 {11, 'e', "escape", "Escape these characters in fields (see note)", OPT_ARGREQ }, 132 {11, 'e', "escape", "Escape these characters in fields (see note)", OPT_ARGREQ },
133 { 3, 'f', "fields", "Show only specified field(s)", OPT_ARGREQ }, 133 { 3, 'f', "fields", "Show only specified field(s)", OPT_ARGREQ },
134 { 4, 'x', "hex", "Use hexadecimal values", OPT_NONE }, 134 { 4, 'x', "hex", "Use hexadecimal values", OPT_NONE },
135 { 7, 'F', "format", "Use given format string (see below)", OPT_ARGREQ }, 135 { 7, 'F', "format", "Use given format string (see below)", OPT_ARGREQ },
136 { 8, 'H', "hvsc", "Specify path to HVSC documents directory", OPT_ARGREQ }, 136 { 8, 'H', "hvsc", "Specify path to HVSC root directory", OPT_ARGREQ },
137 { 9, 'S', "sldb", "Specify Songlengths.(txt|md5) file (use -H if possible)", OPT_ARGREQ }, 137 { 9, 'S', "sldb", "Specify Songlengths.(txt|md5) file (use -H if possible)", OPT_ARGREQ },
138 {12, 'R', "recurse", "Recurse into sub-directories", OPT_NONE }, 138 {12, 'R', "recurse", "Recurse into sub-directories", OPT_NONE },
139 }; 139 };
140 140
141 static const int optListN = sizeof(optList) / sizeof(optList[0]); 141 static const int optListN = sizeof(optList) / sizeof(optList[0]);
1173 1173
1174 1174
1175 char *siCheckHVSCFilePath(const char *filebase, const char *fext) 1175 char *siCheckHVSCFilePath(const char *filebase, const char *fext)
1176 { 1176 {
1177 th_stat_data sdata; 1177 th_stat_data sdata;
1178 char *npath = th_strdup_printf("%s%c%s%s", setHVSCPath, TH_DIR_SEPARATOR, filebase, fext); 1178 char *npath = th_strdup_printf("%s%c%s%c%s%s",
1179 setHVSCPath, TH_DIR_SEPARATOR,
1180 "DOCUMENTS", TH_DIR_SEPARATOR,
1181 filebase, fext);
1179 1182
1180 if (npath != NULL && 1183 if (npath != NULL &&
1181 th_stat_path(npath, &sdata) && 1184 th_stat_path(npath, &sdata) &&
1182 (sdata.flags & TH_IS_READABLE) && 1185 (sdata.flags & TH_IS_READABLE) &&
1183 (sdata.flags & TH_IS_DIR) == 0) 1186 (sdata.flags & TH_IS_DIR) == 0)