Remove vestigal code. - sam - An updated version of the sam text editor. | |
git clone git://vernunftzentrum.de/sam.git | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 865ad2eb92b1e50b67648a99d7800a3d28ba8efc | |
parent ce79fc47ddd96ac43d9ab40078a80fe28a93ec12 | |
Author: Rob King <[email protected]> | |
Date: Fri, 27 Jan 2017 10:14:54 -0600 | |
Remove vestigal code. | |
Diffstat: | |
sam/error.c | 2 +- | |
sam/io.c | 43 ------------------------------ | |
2 files changed, 1 insertion(+), 44 deletions(-) | |
--- | |
diff --git a/sam/error.c b/sam/error.c | |
@@ -58,7 +58,7 @@ static char *wmsg[]={ | |
/* warn_S */ | |
"files might be aliased", | |
/* warn */ | |
- "null characters elided", | |
+ "null characters elided; file will be different upon write", | |
"can't run pwd", | |
"last char not newline", | |
"exit status not 0", | |
diff --git a/sam/io.c b/sam/io.c | |
@@ -206,49 +206,6 @@ readio(File *f, bool *nulls, bool setdate) | |
return nt; | |
} | |
-/* Posn | |
-readio(File *f, bool *nulls, bool setdate) | |
-{ | |
- size_t n = 0; | |
- size_t nt = 0; | |
- Posn p = addr.r.p2; | |
- uint64_t dev, qid; | |
- int64_t mtime; | |
- char buf[BLOCKSIZE+1] = {0}; | |
- const char *bp = buf; | |
- wchar_t wbuf[BLOCKSIZE * MB_LEN_MAX + 1] = {0}; | |
- mbstate_t ps = {0}; | |
- | |
- *nulls = false; | |
- | |
- n = read(io, buf, BLOCKSIZE); | |
- while (n > 0){ | |
- size_t w = mbsrtowcs(wbuf, &bp, BLOCKSIZE, &ps); | |
- if ((ssize_t)w < 0){ | |
- *nulls = true; | |
- warn(Wnottext); | |
- return nt; | |
- } | |
- Finsert(f, tmprstr(wbuf, w), p); | |
- | |
- memset(buf, 0, sizeof(buf)); | |
- nt += n; | |
- n = read(io, buf, BLOCKSIZE); | |
- bp = buf; | |
- } | |
- | |
- if (setdate){ | |
- if (statfd(io, &dev, &qid, &mtime, 0, 0) > 0){ | |
- f->dev = dev; | |
- f->qid = qid; | |
- f->date = mtime; | |
- checkqid(f); | |
- } | |
- } | |
- | |
- return nt; | |
-} */ | |
- | |
Posn | |
writeio(File *f) | |
{ |