From bcd374526f9a699e149fca4de071d418809a19d9 Mon Sep 17 00:00:00 2001
From: Basile Burg <basile.b@gmx.com>
Date: Fri, 5 Aug 2016 21:57:15 +0200
Subject: [PATCH] update fcl-json

---
 etc/fcl-json/src/xjsonconf.pp | 10 +++++-----
 src/ce_dubproject.pas         |  2 +-
 src/ce_main.pas               |  1 +
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/etc/fcl-json/src/xjsonconf.pp b/etc/fcl-json/src/xjsonconf.pp
index 748b8952..f1f096a8 100644
--- a/etc/fcl-json/src/xjsonconf.pp
+++ b/etc/fcl-json/src/xjsonconf.pp
@@ -154,22 +154,22 @@ end;
 procedure TJSONConfig.Flush;
 
 Var
-  F : Text;
+  F : TFileStream;
   S : TJSONStringType;
   
 begin
   if Modified then
     begin
-    AssignFile(F,FileName);
-    Rewrite(F);
+    F:=TFileStream.Create(FileName,fmCreate);
     Try
       if Formatted then
         S:=FJSON.FormatJSON(Formatoptions,FormatIndentSize)
       else
         S:=FJSON.AsJSON;
-      Writeln(F,S);  
+      if S>'' then
+        F.WriteBuffer(S[1],Length(S));  
     Finally
-      CloseFile(F);
+      F.Free;
     end;
     FModified := False;
     end;
diff --git a/src/ce_dubproject.pas b/src/ce_dubproject.pas
index 44b03e78..6357ac1c 100644
--- a/src/ce_dubproject.pas
+++ b/src/ce_dubproject.pas
@@ -370,7 +370,7 @@ begin
     parser := TJSONParser.Create(loader, [joIgnoreTrailingComma, joUTF8]);
     //TODO-cfcl-json: remove etc/fcl-json the day they'll merge and rlz the version with 'Options'
     //TODO-cfcl-json: track possible changes and fixes at http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/packages/fcl-json/
-    //latest in in etc = rev 33310.
+    //latest in etc = rev 34196.
     try
       try
         fJSON := parser.Parse as TJSONObject;
diff --git a/src/ce_main.pas b/src/ce_main.pas
index 12401191..399d80e3 100644
--- a/src/ce_main.pas
+++ b/src/ce_main.pas
@@ -1488,6 +1488,7 @@ procedure TCEMainForm.DoFirstShow;
 var
   url: string;
 begin
+  inherited;
   // TODO-cbetterfix: clipboard doesn't work first time it's used on a reloaded doc.
   // see: http://forum.lazarus.freepascal.org/index.php/topic,30616.0.htm
   if fAppliOpts.reloadLastDocuments then