From 7462095f60191bf420298be41854a14fd01d2864 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 28 Mar 2016 08:29:35 -0400
Subject: [PATCH] Small code improvements

---
 program/lib/Roundcube/rcube_imap_generic.php |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php
index 1800f82..810dcce 100644
--- a/program/lib/Roundcube/rcube_imap_generic.php
+++ b/program/lib/Roundcube/rcube_imap_generic.php
@@ -107,7 +107,11 @@
             $this->debug('C: ' . $log);
         }
 
-        $res = fwrite($this->fp, $string . ($endln ? "\r\n" : ''));
+        if ($endln) {
+            $string .= "\r\n";
+        }
+
+        $res = fwrite($this->fp, $string);
 
         if ($res === false) {
             @fclose($this->fp);
@@ -174,6 +178,7 @@
                 }
             }
         }
+
         return $res;
     }
 
@@ -3465,6 +3470,7 @@
         if (!is_array($entries)) {
             $entries = array($entries);
         }
+
         // create entries string
         // ANNOTATEMORE drafts before version 08 require quoted parameters
         foreach ($entries as $idx => $name) {
@@ -3475,7 +3481,8 @@
         if (!is_array($attribs)) {
             $attribs = array($attribs);
         }
-        // create entries string
+
+        // create attributes string
         foreach ($attribs as $idx => $name) {
             $attribs[$idx] = $this->escape($name, true);
         }

--
Gitblit v1.9.1