summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-10-26 19:21:50 +0200
committerMichael Adam <obnox@samba.org>2013-04-29 13:08:24 +0200
commit92b6fc0edebe5df103c305f2d5226ba37ad632e4 (patch)
tree6ae1d87ba8ec76fc23e0af47634a0e0fe2f76582 /source3/utils
parent7b970e930ef97cef28c1d4b0a576d8f9bb4464e8 (diff)
downloadsamba-92b6fc0edebe5df103c305f2d5226ba37ad632e4.tar.gz
samba-92b6fc0edebe5df103c305f2d5226ba37ad632e4.tar.bz2
samba-92b6fc0edebe5df103c305f2d5226ba37ad632e4.zip
regedit: Improve the while loop.
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/regedit.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/source3/utils/regedit.c b/source3/utils/regedit.c
index 86e367f94e..824bc3f86f 100644
--- a/source3/utils/regedit.c
+++ b/source3/utils/regedit.c
@@ -438,7 +438,7 @@ static void display_window(TALLOC_CTX *mem_ctx, struct registry_context *ctx)
{
struct regedit *regedit;
struct tree_node *root;
- int c;
+ int key;
initscr();
start_color();
@@ -479,15 +479,14 @@ static void display_window(TALLOC_CTX *mem_ctx, struct registry_context *ctx)
update_panels();
doupdate();
- while (1) {
- c = regedit_getch();
- if (c == 'q' || c == 'Q') {
- break;
- }
- handle_main_input(regedit, c);
+
+ do {
+ key = regedit_getch();
+
+ handle_main_input(regedit, key);
update_panels();
doupdate();
- }
+ } while (key != 'q' || key == 'Q');
endwin();
}