]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: plain format always appends eol to data
authorYehuda Sadeh <yehuda@inktank.com>
Fri, 8 Feb 2013 21:16:36 +0000 (13:16 -0800)
committerYehuda Sadeh <yehuda@inktank.com>
Sat, 9 Feb 2013 21:36:01 +0000 (13:36 -0800)
Beforehand we just prepended the eol to the next line, so that
the last line also gets eol.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_formats.cc

index 61d4d04c7a4f5102e0b558c3aa32b73b7a2a7ddb..3a0dc76397ec1a3fb784af9ef1e06f53ebe6589e 100644 (file)
@@ -135,10 +135,7 @@ void RGWFormatter_Plain::dump_format(const char *name, const char *fmt, ...)
   va_start(ap, fmt);
   vsnprintf(buf, LARGE_SIZE, fmt, ap);
   va_end(ap);
-  if (len)
-    format = "\n%s";
-  else
-    format = "%s";
+  format = "%s\n";
 
   write_data(format, buf);
 }
@@ -233,11 +230,5 @@ void RGWFormatter_Plain::dump_value_int(const char *name, const char *fmt, ...)
   vsnprintf(buf, LARGE_SIZE, fmt, ap);
   va_end(ap);
 
-  const char *eol;
-  if (len)
-    eol = "\n";
-  else
-    eol = "";
-
-  write_data("%s%s", eol, buf);
+  write_data("%s\n", buf);
 }