Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH 2/2] Fix two C nits



- avoid returning from a function that will never return
- use "ifdef" instead of "if" for checking if preprocessor exists

Signed-off-by: Eitan Adler <lists@xxxxxxxxxxxxxx>
---
 Src/exec.c       | 1 -
 Src/zsh_system.h | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/Src/exec.c b/Src/exec.c
index d44527841..b36bcef64 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -4954,7 +4954,6 @@ getpipe(char *cmd, int nullexec)
     execode(prog, 0, 1, out ? "outsubst" : "insubst");
     cmdpop();
     _exit(lastval);
-    return 0;
 }
 
 /* open pipes with fds >= 10 */
diff --git a/Src/zsh_system.h b/Src/zsh_system.h
index 5339b496f..d9b8617c5 100644
--- a/Src/zsh_system.h
+++ b/Src/zsh_system.h
@@ -735,7 +735,7 @@ extern char **environ;
 
 /* These variables are sometimes defined in, *
  * and needed by, the termcap library.       */
-#if MUST_DEFINE_OSPEED
+#ifdef MUST_DEFINE_OSPEED
 extern char PC, *BC, *UP;
 extern short ospeed;
 #endif
-- 
2.17.1



Messages sorted by: Reverse Date, Date, Thread, Author