From ff8baa3a5730ea296e9b2f19cba6e1fcaaa5c5d7 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 14 Sep 2009 14:08:50 -0700 Subject: [PATCH] games - backgammon - use defined names instead of magic numbers. Submitted-by: Ulrich Spoerlein --- games/backgammon/common_source/save.c | 2 +- games/backgammon/common_source/table.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/games/backgammon/common_source/save.c b/games/backgammon/common_source/save.c index 3250c7ddc7..6a0f27a637 100644 --- a/games/backgammon/common_source/save.c +++ b/games/backgammon/common_source/save.c @@ -74,7 +74,7 @@ save(int n) writel (prompt); fs = fname; while ((*fs = readc()) != '\n') { - if (*fs == tty.c_cc[2]) { + if (*fs == tty.c_cc[VERASE]) { if (fs > fname) { fs--; if (tflag) diff --git a/games/backgammon/common_source/table.c b/games/backgammon/common_source/table.c index 6c3944ed2d..7635023eac 100644 --- a/games/backgammon/common_source/table.c +++ b/games/backgammon/common_source/table.c @@ -112,11 +112,11 @@ dochar: } } - if (c == tty.c_cc[2] && ncin > 0) { + if (c == tty.c_cc[VERASE] && ncin > 0) { if (tflag) curmove (curr,curc-1); else { - if (tty.c_cc[2] == '\010') + if (tty.c_cc[VERASE] == '\010') writel ("\010 \010"); else writec (cin[ncin-1]); @@ -133,13 +133,13 @@ dochar: goto domove; } - if (c == tty.c_cc[3] && ncin > 0) { + if (c == tty.c_cc[VKILL] && ncin > 0) { if (tflag) { refresh(); curmove (curr,39); ist = -1; goto domove; - } else if (tty.c_cc[2] == '\010') { + } else if (tty.c_cc[VERASE] == '\010') { for (j = 0; j < ncin; j++) writel ("\010 \010"); ist = -1; -- 2.11.4.GIT