FreeBSD Bugzilla – Attachment 11226 Details for
Bug 22182
vi(1) options noprint/print/octal broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.15 KB, created by
Christian Weisgerber
on 2000-10-21 14:40:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Christian Weisgerber
Created:
2000-10-21 14:40:01 UTC
Size:
3.15 KB
patch
obsolete
>diff -ur /usr/src/contrib/nvi/common/options.c nvi/common/options.c >--- /usr/src/contrib/nvi/common/options.c Sat Apr 19 01:36:33 1997 >+++ nvi/common/options.c Sat Oct 21 14:42:25 2000 >@@ -128,11 +128,11 @@ > /* O_MSGCAT 4.4BSD */ > {"msgcat", f_msgcat, OPT_STR, 0}, > /* O_NOPRINT 4.4BSD */ >- {"noprint", f_print, OPT_STR, 0}, >+ {"noprint", f_print, OPT_STR, OPT_EARLYSET}, > /* O_NUMBER 4BSD */ > {"number", f_reformat, OPT_0BOOL, 0}, > /* O_OCTAL 4.4BSD */ >- {"octal", f_print, OPT_0BOOL, 0}, >+ {"octal", f_print, OPT_0BOOL, OPT_EARLYSET}, > /* O_OPEN 4BSD */ > {"open", NULL, OPT_1BOOL, 0}, > /* O_OPTIMIZE 4BSD */ >@@ -142,7 +142,7 @@ > /* O_PATH 4.4BSD */ > {"path", NULL, OPT_STR, 0}, > /* O_PRINT 4.4BSD */ >- {"print", f_print, OPT_STR, 0}, >+ {"print", f_print, OPT_STR, OPT_EARLYSET}, > /* O_PROMPT 4BSD */ > {"prompt", NULL, OPT_1BOOL, 0}, > /* O_READONLY 4BSD (undocumented) */ >@@ -568,6 +568,14 @@ > break; > } > >+ if (F_ISSET(op, OPT_EARLYSET)) { >+ /* Set the value. */ >+ if (turnoff) >+ O_CLR(sp, offset); >+ else >+ O_SET(sp, offset); >+ } >+ > /* Report to subsystems. */ > if (op->func != NULL && > op->func(sp, spo, NULL, &turnoff) || >@@ -578,11 +586,13 @@ > break; > } > >- /* Set the value. */ >- if (turnoff) >+ if (!F_ISSET(op, OPT_EARLYSET)) { >+ /* Set the value. */ >+ if (turnoff) > O_CLR(sp, offset); >- else >+ else > O_SET(sp, offset); >+ } > break; > case OPT_NUM: > if (turnoff) { >@@ -653,6 +663,14 @@ > O_VAL(sp, offset) == value) > break; > >+ if (F_ISSET(op, OPT_EARLYSET)) { >+ /* Set the value. */ >+ if (o_set(sp, offset, 0, NULL, value)) { >+ rval = 1; >+ break; >+ } >+ } >+ > /* Report to subsystems. */ > if (op->func != NULL && > op->func(sp, spo, sep, &value) || >@@ -663,9 +681,11 @@ > break; > } > >- /* Set the value. */ >- if (o_set(sp, offset, 0, NULL, value)) >+ if (!F_ISSET(op, OPT_EARLYSET)) { >+ /* Set the value. */ >+ if (o_set(sp, offset, 0, NULL, value)) > rval = 1; >+ } > break; > case OPT_STR: > if (turnoff) { >@@ -690,6 +710,14 @@ > !strcmp(O_STR(sp, offset), sep)) > break; > >+ if (F_ISSET(op, OPT_EARLYSET)) { >+ /* Set the value. */ >+ if (o_set(sp, offset, OS_STRDUP, sep, 0)) { >+ rval = 1; >+ break; >+ } >+ } >+ > /* Report to subsystems. */ > if (op->func != NULL && > op->func(sp, spo, sep, NULL) || >@@ -700,9 +728,11 @@ > break; > } > >- /* Set the value. */ >- if (o_set(sp, offset, OS_STRDUP, sep, 0)) >+ if (!F_ISSET(op, OPT_EARLYSET)) { >+ /* Set the value. */ >+ if (o_set(sp, offset, OS_STRDUP, sep, 0)) > rval = 1; >+ } > break; > default: > abort(); >diff -ur /usr/src/contrib/nvi/common/options.h nvi/common/options.h >--- /usr/src/contrib/nvi/common/options.h Fri Nov 1 07:45:38 1996 >+++ nvi/common/options.h Sat Oct 21 14:41:48 2000 >@@ -89,6 +89,7 @@ > #define OPT_NOSET 0x010 /* Option may not be set. */ > #define OPT_NOUNSET 0x020 /* Option may not be unset. */ > #define OPT_NOZERO 0x040 /* Option may not be set to 0. */ >+#define OPT_EARLYSET 0x080 /* Func called after value is set */ > u_int8_t flags; > };
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 22182
: 11226