edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] [PATCH 1/2] Allow opening of existing files containing #
@ 2011-12-19 14:15 Tyler Spivey
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Tyler Spivey @ 2011-12-19 14:15 UTC (permalink / raw)
  To: edbrowse-dev

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-19 18:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-19 14:15 [Edbrowse-dev] [PATCH 1/2] Allow opening of existing files containing # Tyler Spivey
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

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).