Bug 125348

Summary: lang/nawk: support multibyte charsets in tolower/toupper functions
Product: Ports & Packages Reporter: Pedro F. Giffuni <pfgshield-freebsd>
Component: Individual Port(s)Assignee: Stefan Walter <stefan>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff
none
patch-nawk
none
patch-nawk
none
patch-main.c none

Description Pedro F. Giffuni 2008-07-06 22:10:09 UTC
Update with patches from NetBSD:

- PR 36394: Add support for multibyte charsets in the "tolower" and "toupper" awk
functions.
- PR 36831: In setfval(), ensure that arithmetic never yields a negative zero
result.
- strdup/strlcat/snprintf changes from Aleksey Cheusov

How-To-Repeat: Probably this is also relevant to the base one-true-awk (and upstream).
Comment 1 Pedro F. Giffuni 2008-07-07 04:47:54 UTC
I have an additional patch from OpenBSD which extends awk with bitwise operations (based on gawk) -- attached.

I am not sure if we want to diverge from the historic nawk so I'll try to contact the author. 

I should also mention that recent versions of nawk don't pass the mawk fpe_test, which must be investigated too :( .



      Posta, news, sport, oroscopo: tutto in una sola pagina. 
Crea l&#39;home page che piace a te!
www.yahoo.it/latuapagina
Comment 2 Pedro F. Giffuni 2008-07-07 17:16:20 UTC
The upstream maintainer doesn't want to add extensions or support multibyte chars.

I think FreeBSD might want to adopt them but for the time being it's better to just try to get some patches harmonized among all the BSDs and the maintainer.

Let's just add this minimalistic patch (mostly from OpenBSD):
- replace sprintf with snprintf
- use calloc() to avoid malloc(n * m) overflows
- NetBSD PR 36831: In setfval(), ensure that arithmetic never yields a negative zero result.



      Posta, news, sport, oroscopo: tutto in una sola pagina. 
Crea l&#39;home page che piace a te!
www.yahoo.it/latuapagina
Comment 3 Pedro F. Giffuni 2008-07-08 21:43:11 UTC
The attached patch restores the traditional (FreeBSD <= 2.x I recall) behavior of trapping FPEs. With this patch we pass mawk's fpe_test.

(I know ..the title of this PR is obsolete now but it wouldn't make sense to open a new PR).


      Posta, news, sport, oroscopo: tutto in una sola pagina. 
Crea l&#39;home page che piace a te!
www.yahoo.it/latuapagina
Comment 4 Stefan Walter freebsd_committer freebsd_triage 2008-10-20 15:38:45 UTC
Responsible Changed
From-To: freebsd-ports-bugs->stefan

Take.
Comment 5 Stefan Walter freebsd_committer freebsd_triage 2008-10-20 15:52:34 UTC
State Changed
From-To: open->closed

Committed the last two patches, thanks!
Comment 6 dfilter service freebsd_committer freebsd_triage 2008-10-20 15:52:37 UTC
stefan      2008-10-20 14:52:28 UTC

  FreeBSD ports repository

  Modified files:
    lang/nawk            Makefile 
  Added files:
    lang/nawk/files      patch-b.c patch-lib.c patch-main.c 
                         patch-tran.c 
  Log:
  Add patches:
  
  - replace sprintf with snprintf
  - use calloc() to avoid malloc(n * m) overflows
  - NetBSD PR 36831: In setfval(), ensure that arithmetic never yields a negative
    zero result.
  - Restore the traditional (FreeBSD <= 2.x) behavior of trapping FPEs. With this
    patch we pass mawk's fpe_test.
  
  PR:             125348
  Submitted by:   "Pedro F. Giffuni" <pfgshield-freebsd@yahoo.com>
  
  Revision  Changes    Path
  1.36      +1 -0      ports/lang/nawk/Makefile
  1.1       +67 -0     ports/lang/nawk/files/patch-b.c (new)
  1.3       +29 -0     ports/lang/nawk/files/patch-lib.c (new)
  1.1       +19 -0     ports/lang/nawk/files/patch-main.c (new)
  1.1       +23 -0     ports/lang/nawk/files/patch-tran.c (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"