Module Name:    src
Committed By:   martin
Date:           Sun Jun 23 11:22:48 UTC 2019

Modified Files:
        src/usr.bin/menuc: menu_sys.def menuc.1

Log Message:
Use OPT_NOMENU as error return for new_menu (instead of old hard coded -1).
Update man page for the OPT_NOMENU change.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/usr.bin/menuc/menu_sys.def
cvs rdiff -u -r1.37 -r1.38 src/usr.bin/menuc/menuc.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/menuc/menu_sys.def
diff -u src/usr.bin/menuc/menu_sys.def:1.70 src/usr.bin/menuc/menu_sys.def:1.71
--- src/usr.bin/menuc/menu_sys.def:1.70	Sat Jun 22 20:44:54 2019
+++ src/usr.bin/menuc/menu_sys.def	Sun Jun 23 11:22:48 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: menu_sys.def,v 1.70 2019/06/22 20:44:54 christos Exp $	*/
+/*	$NetBSD: menu_sys.def,v 1.71 2019/06/23 11:22:48 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -859,12 +859,12 @@ new_menu(const char *title, menu_ent *op
 	/* Find free menu entry. */
 	for (ix = DYN_MENU_START; ; ix++) {
 		if (ix >= num_menus && !double_menus())
-			return -1;
+			return OPT_NOMENU;
 		m = menu_list[ix];
 		if (m == NULL) {
 			m = calloc(sizeof *m, 1);
 			if (m == NULL)
-				return -1;
+				return OPT_NOMENU;
 			menu_list[ix] = m;
 			break;
 		}

Index: src/usr.bin/menuc/menuc.1
diff -u src/usr.bin/menuc/menuc.1:1.37 src/usr.bin/menuc/menuc.1:1.38
--- src/usr.bin/menuc/menuc.1:1.37	Mon Feb 25 20:47:37 2019
+++ src/usr.bin/menuc/menuc.1	Sun Jun 23 11:22:48 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: menuc.1,v 1.37 2019/02/25 20:47:37 martin Exp $
+.\"	$NetBSD: menuc.1,v 1.38 2019/06/23 11:22:48 martin Exp $
 .\"
 .\" Copyright 1997 Piermont Information Systems Inc.
 .\" All rights reserved.
@@ -424,7 +424,7 @@ struct menu_ent {
 } menu_ent ;
 
 /* For opt_menu */
-#define OPT_NOMENU -1
+#define OPT_NOMENU 0
 
 /* For opt_flags */
 #define OPT_SUB     1

Reply via email to