tmp = new File(tmpDir, "fanfic-tmp");
}
if (readerTmp == null) {
- tmp = new File(tmpDir, "fanfic-reader");
+ readerTmp = new File(tmpDir, "fanfic-reader");
}
} else {
syserr(new IOException(
String typeString = null;
String chapString = null;
String target = null;
- String readerTypeString = null;
MainAction action = null;
Boolean plusInfo = null;
exitCode = 255;
break;
case SET_READER:
- if (readerTypeString == null) {
- readerTypeString = args[i];
- } else {
- exitCode = 255;
- }
+ exitCode = setReaderType(args[i]);
break;
}
}
exitCode = 0;
break;
case SET_READER:
- exitCode = setReaderType(readerTypeString);
break;
}
}
*/
private static int setReaderType(String readerTypeString) {
try {
- ReaderType readerType = ReaderType.valueOf(readerTypeString);
+ ReaderType readerType = ReaderType.valueOf(readerTypeString
+ .toUpperCase());
BasicReader.setDefaultReaderType(readerType);
return 0;
} catch (IllegalArgumentException e) {
try {
String value = getLine(infoIn, key, 0);
if (value != null && !value.isEmpty()) {
- value = value.trim().substring(key.length()).trim();
+ value = value.trim().substring(key.length() - 1).trim();
if (value.startsWith("'") && value.endsWith("'")
|| value.startsWith("\"") && value.endsWith("\"")) {
value = value.substring(1, value.length() - 1).trim();
}
-
+
return value;
}
} finally {