All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Devine <fxmulder@gmail.com>
To: ceph-devel@vger.kernel.org
Subject: [PATCH] Allow CRLF in config files
Date: Mon, 15 Jun 2015 17:53:38 -0600	[thread overview]
Message-ID: <1434412418-32247-1-git-send-email-fxmulder@gmail.com> (raw)

Change config fopen to binary mode, allowing LF and CRLF EOL characters so
ceph-dokan can work with native windows configuration files going forward.
The carriage return is ignored and trimmed as whitespace during parsing via
isspace().

Signed-off-by: James Devine <fxmulder@gmail.com>
---
 src/common/ConfUtils.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/ConfUtils.cc b/src/common/ConfUtils.cc
index 1ae5df5..a717077 100644
--- a/src/common/ConfUtils.cc
+++ b/src/common/ConfUtils.cc
@@ -99,7 +99,7 @@ parse_file(const std::string &fname, std::deque<std::string> *errors,
   int ret = 0;
   size_t sz;
   char *buf = NULL;
-  FILE *fp = fopen(fname.c_str(), "r");
+  FILE *fp = fopen(fname.c_str(), "rb");
   if (!fp) {
     ret = -errno;
     return ret;
-- 
1.9.1


             reply	other threads:[~2015-06-16  0:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-15 23:53 James Devine [this message]
2015-06-16  9:54 ` [PATCH] Allow CRLF in config files Gregory Farnum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1434412418-32247-1-git-send-email-fxmulder@gmail.com \
    --to=fxmulder@gmail.com \
    --cc=ceph-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.