Style fixes. - sam - An updated version of the sam text editor.
(HTM) git clone git://vernunftzentrum.de/sam.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit 7b1ed774258441e979c700fa1ff933c6b817778c
(DIR) parent 36d1b635905551a9fbae6ab7f175e7f25740bd43
(HTM) Author: Rob King <jking@deadpixi.com>
Date: Sat, 10 Sep 2016 23:09:00 -0500
Style fixes.
Diffstat:
sam/cmd.c | 8 +++++---
sam/sam.c | 9 +++++----
2 files changed, 10 insertions(+), 7 deletions(-)
---
(DIR) diff --git a/sam/cmd.c b/sam/cmd.c
@@ -92,7 +92,7 @@ inputc(void)
terminp = termoutp = termline;
}else{
do{
- n = read(0, buf+nbuf, 1);
+ n = read(STDIN_FILENO, buf+nbuf, 1);
if(n <= 0)
return -1;
nbuf += n;
@@ -216,10 +216,12 @@ cmdloop(void)
freecmd();
cmdupdate();
update();
- if(downloaded && curfile &&
- (ocurfile!=curfile || (!loaded && curfile->state!=Unread)))
+ if(downloaded
+ && curfile
+ &&(ocurfile != curfile || (!loaded && curfile->state != Unread)))
outTs(Hcurrent, curfile->tag);
/* don't allow type ahead on files that aren't bound */
+
if(downloaded && curfile && curfile->rasp == 0)
terminp = termoutp;
}
(DIR) diff --git a/sam/sam.c b/sam/sam.c
@@ -1,6 +1,7 @@
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */
#include "sam.h"
+#include <stdbool.h>
#include <unistd.h>
Rune genbuf[BLOCKSIZE];
@@ -22,8 +23,8 @@ List tempfile;
int quitok = TRUE;
int downloaded;
int expandtabs;
-int dflag;
-int Rflag;
+bool dflag;
+bool Rflag;
char *machine;
char *home;
int bpipeok;
@@ -57,7 +58,7 @@ main(int argc, char *argv[])
break;
case 'd':
- dflag = 1;
+ dflag = true;
break;
case 'r':
@@ -68,7 +69,7 @@ main(int argc, char *argv[])
break;
case 'R':
- Rflag = 1;
+ Rflag = true;
break;
case 't':