X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;ds=inline;f=cmd%2Fsafcm-remote%2Fsync%2Ffiles.go;h=e0a2221009deda9824aa38419fec6ffc1decc0f0;hb=8a3f6af248e28ea7efc1bf89751a597d28834942;hp=119a3534239f68e2e5d10aee08ec2559590ada87;hpb=5d6cc7f14a4bacc36bf3a23cd735a75ad4a90f1d;p=safcm%2Fsafcm.git
diff --git a/cmd/safcm-remote/sync/files.go b/cmd/safcm-remote/sync/files.go
index 119a353..e0a2221 100644
--- a/cmd/safcm-remote/sync/files.go
+++ b/cmd/safcm-remote/sync/files.go
@@ -15,6 +15,8 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
+// +build !windows
+
package sync
import (
@@ -452,13 +454,16 @@ func diffData(oldData []byte, newData []byte) (string, error) {
oldBin := !strings.HasPrefix(http.DetectContentType(oldData), "text/")
newBin := !strings.HasPrefix(http.DetectContentType(newData), "text/")
if oldBin && newBin {
- return "Binary files differ, cannot show diff", nil
+ return fmt.Sprintf("Binary files differ (%d -> %d bytes), "+
+ "cannot show diff", len(oldData), len(newData)), nil
}
if oldBin {
- oldData = []byte("\n")
+ oldData = []byte(fmt.Sprintf("\n",
+ len(oldData)))
}
if newBin {
- newData = []byte("\n")
+ newData = []byte(fmt.Sprintf("\n",
+ len(newData)))
}
// TODO: difflib shows empty context lines at the end of the file