From: Tyler Spivey <tspivey@pcdesk.net>
To: edbrowse-dev@lists.the-brannons.com
Subject: [Edbrowse-dev] [PATCH 1/2] Allow opening of existing files containing #
Date: Mon, 19 Dec 2011 06:15:19 -0800 [thread overview]
Message-ID: <1324304120-32208-1-git-send-email-tspivey@pcdesk.net> (raw)
If a filename contains # and already exists, edit it.
---
src/buffers.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/buffers.c b/src/buffers.c
index a203006..6ba5ada 100644
--- a/src/buffers.c
+++ b/src/buffers.c
@@ -1119,6 +1119,7 @@ readFile(const char *filename, const char *post)
bool rc; /* return code */
bool is8859, isutf8;
char *nopound;
+char filetype;
serverData = 0;
serverDataLen = 0;
@@ -1195,9 +1196,10 @@ readFile(const char *filename, const char *post)
}
fromdisk:
+ filetype = fileTypeByName(filename, false);
/* reading a file from disk */
fileSize = 0;
- if(fileTypeByName(filename, false) == 'd') {
+ if(filetype == 'd') {
/* directory scan */
int len, j, start, end;
cw->baseDirName = cloneString(filename);
@@ -1273,7 +1275,7 @@ readFile(const char *filename, const char *post)
nopound = cloneString(filename);
rbuf = strchr(nopound, '#');
- if(rbuf)
+ if (rbuf && !filetype)
*rbuf = 0;
rc = fileIntoMemory(nopound, &rbuf, &fileSize);
nzFree(nopound);
--
1.7.7.4
next reply other threads:[~2011-12-19 14:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-19 14:15 Tyler Spivey [this message]
2011-12-19 14:15 ` [Edbrowse-dev] [PATCH 2/2] Only check for sql if compiled in Tyler Spivey
2011-12-19 18:55 ` [Edbrowse-dev] [PATCH 1/2] Allow opening of existing files containing # chris
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=1324304120-32208-1-git-send-email-tspivey@pcdesk.net \
--to=tspivey@pcdesk.net \
--cc=edbrowse-dev@lists.the-brannons.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).