• R/O
  • SSH
  • HTTPS

ktx: Commit


Commit MetaInfo

Revision40 (tree)
Zeit2020-02-11 10:47:41
Autorbananajinn

Log Message

コマンドライン引数で指定したファイルのエンコーディングが判別できない場合に落ちていたのを修正

Ändern Zusammenfassung

Diff

--- trunk/ktx/Program.cs (revision 39)
+++ trunk/ktx/Program.cs (revision 40)
@@ -24,20 +24,19 @@
2424 Application.SetCompatibleTextRenderingDefault(false);
2525 var mf = new MainForm();
2626 mf.Show();
27- if(args.Length > 0){
27+ if (args.Length > 0) {
2828 int cp = 0;
2929 string path = null;
30- foreach(var arg in args){
30+ foreach (var arg in args) {
3131 var m = Regex.Match(arg, "[/-]cp([0-9]+)");
32- if(m.Success){
32+ if (m.Success) {
3333 int.TryParse(m.Groups[1].Value, out cp);
34- }
35- else {
34+ } else {
3635 path = arg;
3736 }
3837 }
39- if(path != null){
40- mf.FileEncoding = cp == 0 ? FileEncodingDetector.GetEncoding(path) : Encoding.GetEncoding(cp);
38+ if (path != null) {
39+ mf.FileEncoding = cp == 0 ? (FileEncodingDetector.GetEncoding(path) ?? Encoding.UTF8) : Encoding.GetEncoding(cp);
4140 mf.Path = path;
4241 }
4342 }
--- trunk/ktx/Properties/AssemblyInfo.cs (revision 39)
+++ trunk/ktx/Properties/AssemblyInfo.cs (revision 40)
@@ -28,4 +28,4 @@
2828 //
2929 // You can specify all the values or you can use the default the Revision and
3030 // Build Numbers by using the '*' as shown below:
31-[assembly: AssemblyVersion("0.11.1")]
31+[assembly: AssemblyVersion("0.11.2")]
Show on old repository browser