Changeset 1199 for trunk/src/kash/var.c
- Timestamp:
- Oct 7, 2007, 12:04:05 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/var.c
r1198 r1199 332 332 namelen = p - name; 333 333 if (isbad) 334 error( "%.*s: bad variable name", namelen, name);334 error(psh, "%.*s: bad variable name", namelen, name); 335 335 len = namelen + 2; /* 2 is space for '=' and '\0' */ 336 336 if (val == NULL) { … … 370 370 if (vp != NULL) { 371 371 if (vp->flags & VREADONLY) 372 error( "%.*s: is read only", vp->name_len, s);372 error(psh, "%.*s: is read only", vp->name_len, s); 373 373 if (flags & VNOSET) 374 374 return; … … 575 575 576 576 if (strcspn(p, "|&;<>()$`\\\"' \t\n*?[]#~=%") == strlen(p)) { 577 out1fmt( "%s", p);577 out1fmt(psh, "%s", p); 578 578 return; 579 579 } 580 580 while (*p) { 581 581 if (*p == '\'') { 582 out1fmt( "\\'");582 out1fmt(psh, "\\'"); 583 583 p++; 584 584 continue; … … 586 586 q = index(p, '\''); 587 587 if (!q) { 588 out1fmt( "'%s'", p );588 out1fmt(psh, "'%s'", p ); 589 589 return; 590 590 } 591 out1fmt( "'%.*s'", (int)(q - p), p );591 out1fmt(psh, "'%.*s'", (int)(q - p), p ); 592 592 p = q; 593 593 } … … 648 648 vp = *vpp; 649 649 if (name) 650 out1fmt( "%s ", name);650 out1fmt(psh, "%s ", name); 651 651 for (p = vp->text ; *p != '=' ; p++) 652 out1c( *p);652 out1c(psh, *p); 653 653 if (!(vp->flags & VUNSET) && show_value) { 654 out1fmt( "=");655 print_quoted( ++p);656 } 657 out1c( '\n');654 out1fmt(psh, "="); 655 print_quoted(psh, ++p); 656 } 657 out1c(psh, '\n'); 658 658 } 659 659 return 0; … … 707 707 708 708 if (! in_function(psh)) 709 error( "Not in a function");709 error(psh, "Not in a function"); 710 710 while ((name = *argptr++) != NULL) { 711 711 mklocal(name, 0); … … 774 774 localvars = lvp->next; 775 775 vp = lvp->vp; 776 TRACE(( "poplocalvar %s", vp ? vp->text : "-"));776 TRACE((psh, "poplocalvar %s", vp ? vp->text : "-")); 777 777 if (vp == NULL) { /* $- saved */ 778 778 memcpy(optlist, lvp->text, sizeof_optlist); … … 801 801 setvar(argv[1], argv[2], 0); 802 802 else 803 error( "List assignment not implemented");803 error(psh, "List assignment not implemented"); 804 804 return 0; 805 805 }
Note:
See TracChangeset
for help on using the changeset viewer.