aboutsummaryrefslogtreecommitdiff
path: root/editors/awk.c
diff options
context:
space:
mode:
Diffstat (limited to 'editors/awk.c')
-rw-r--r--editors/awk.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/editors/awk.c b/editors/awk.c
index 09fb41d68..cb74a9832 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -378,7 +378,7 @@ static unsigned long tokeninfo[] = {
378}; 378};
379 379
380/* internal variable names and their initial values */ 380/* internal variable names and their initial values */
381/* asterisk marks SPECIAL vars; $ is just no-named Field0 */ 381/* asterisk marks SPECIAL vars; $ is just no-named Field0 */
382enum { 382enum {
383 CONVFMT=0, OFMT, FS, OFS, 383 CONVFMT=0, OFMT, FS, OFS,
384 ORS, RS, RT, FILENAME, 384 ORS, RS, RT, FILENAME,
@@ -390,7 +390,7 @@ enum {
390 390
391static char * vNames = 391static char * vNames =
392 "CONVFMT\0" "OFMT\0" "FS\0*" "OFS\0" 392 "CONVFMT\0" "OFMT\0" "FS\0*" "OFS\0"
393 "ORS\0" "RS\0*" "RT\0" "FILENAME\0" 393 "ORS\0" "RS\0*" "RT\0" "FILENAME\0"
394 "SUBSEP\0" "ARGIND\0" "ARGC\0" "ARGV\0" 394 "SUBSEP\0" "ARGIND\0" "ARGC\0" "ARGV\0"
395 "ERRNO\0" "FNR\0" 395 "ERRNO\0" "FNR\0"
396 "NR\0" "NF\0*" "IGNORECASE\0*" 396 "NR\0" "NF\0*" "IGNORECASE\0*"
@@ -486,7 +486,7 @@ static unsigned int hashidx(char *name) {
486static xhash *hash_init(void) { 486static xhash *hash_init(void) {
487 487
488 xhash *newhash; 488 xhash *newhash;
489 489
490 newhash = (xhash *)xcalloc(1, sizeof(xhash)); 490 newhash = (xhash *)xcalloc(1, sizeof(xhash));
491 newhash->csize = FIRST_PRIME; 491 newhash->csize = FIRST_PRIME;
492 newhash->items = (hash_item **)xcalloc(newhash->csize, sizeof(hash_item *)); 492 newhash->items = (hash_item **)xcalloc(newhash->csize, sizeof(hash_item *));
@@ -1053,7 +1053,7 @@ static node *parse_expr(unsigned long iexp) {
1053 /* for binary and postfix-unary operators, jump back over 1053 /* for binary and postfix-unary operators, jump back over
1054 * previous operators with higher priority */ 1054 * previous operators with higher priority */
1055 vn = cn; 1055 vn = cn;
1056 while ( ((t.info & PRIMASK) > (vn->a.n->info & PRIMASK2)) || 1056 while ( ((t.info & PRIMASK) > (vn->a.n->info & PRIMASK2)) ||
1057 ((t.info == vn->info) && ((t.info & OPCLSMASK) == OC_COLON)) ) 1057 ((t.info == vn->info) && ((t.info & OPCLSMASK) == OC_COLON)) )
1058 vn = vn->a.n; 1058 vn = vn->a.n;
1059 if ((t.info & OPCLSMASK) == OC_TERNARY) 1059 if ((t.info & OPCLSMASK) == OC_TERNARY)
@@ -1085,7 +1085,7 @@ static node *parse_expr(unsigned long iexp) {
1085 xtc = TC_OPERAND | TC_UOPPRE | TC_REGEXP; 1085 xtc = TC_OPERAND | TC_UOPPRE | TC_REGEXP;
1086 if (tc & (TC_OPERAND | TC_REGEXP)) { 1086 if (tc & (TC_OPERAND | TC_REGEXP)) {
1087 xtc = TC_UOPPRE | TC_BINOP | TC_OPERAND | iexp; 1087 xtc = TC_UOPPRE | TC_BINOP | TC_OPERAND | iexp;
1088 /* one should be very careful with switch on tclass - 1088 /* one should be very careful with switch on tclass -
1089 * only simple tclasses should be used! */ 1089 * only simple tclasses should be used! */
1090 switch (tc) { 1090 switch (tc) {
1091 case TC_VARIABLE: 1091 case TC_VARIABLE:
@@ -1103,7 +1103,7 @@ static node *parse_expr(unsigned long iexp) {
1103 } 1103 }
1104 xtc = TC_UOPPOST | TC_UOPPRE | TC_BINOP | TC_OPERAND | iexp; 1104 xtc = TC_UOPPOST | TC_UOPPRE | TC_BINOP | TC_OPERAND | iexp;
1105 break; 1105 break;
1106 1106
1107 case TC_NUMBER: 1107 case TC_NUMBER:
1108 case TC_STRING: 1108 case TC_STRING:
1109 cn->info = OC_VAR; 1109 cn->info = OC_VAR;
@@ -1763,7 +1763,7 @@ static char *awk_printf(node *n) {
1763 s = f; 1763 s = f;
1764 while (*f && (*f != '%' || *(++f) == '%')) 1764 while (*f && (*f != '%' || *(++f) == '%'))
1765 f++; 1765 f++;
1766 while (*f && !isalpha(*f)) 1766 while (*f && !isalpha(*f))
1767 f++; 1767 f++;
1768 1768
1769 incr = (f - s) + MAXVARFMT; 1769 incr = (f - s) + MAXVARFMT;