summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2019-09-09 11:20:47 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-09-09 15:15:03 +0200
commita10dbfc4175867c0d15f02b7f244837c5d41478e (patch)
tree3d61ac3ce520f126ba8bfd27f52388129e32d032 /commands
parentea06d25a931324f8c082d13522c9125468cec317 (diff)
downloadbarebox-a10dbfc4175867c0d15f02b7f244837c5d41478e.tar.gz
edit: replace ASCII codes by symbolic names
Code has some magic numbers, replace them. This has the added benefit that at least the touched lines are now charset-agnostic. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/edit.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/commands/edit.c b/commands/edit.c
index 290222c..ba6a8c7 100644
--- a/commands/edit.c
+++ b/commands/edit.c
@@ -524,12 +524,12 @@ static int do_edit(int argc, char *argv[])
} else
delete_char(textx);
break;
- case 13:
- case 10:
+ case '\r':
+ case '\n':
split_line();
break;
case 127:
- case 8:
+ case '\b':
if (textx > 0) {
textx--;
delete_char(textx);
@@ -542,10 +542,10 @@ static int do_edit(int argc, char *argv[])
merge_line(curline);
}
break;
- case 4:
+ case CTL_CH('d'):
ret = save_file(argv[1]);
goto out;
- case 3:
+ case CTL_CH('c'):
goto out;
default:
if ((signed char)c != -1)