Bug 125348 - lang/nawk: support multibyte charsets in tolower/toupper functions
Summary: lang/nawk: support multibyte charsets in tolower/toupper functions
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Stefan Walter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-06 22:10 UTC by Pedro F. Giffuni
Modified: 2008-10-20 16:00 UTC (History)
0 users

See Also:


Attachments
file.diff (1.87 KB, patch)
2008-07-06 22:10 UTC, Pedro F. Giffuni
no flags Details | Diff
patch-nawk (8.78 KB, application/octet-stream)
2008-07-07 04:47 UTC, Pedro F. Giffuni
no flags Details
patch-nawk (4.86 KB, application/octet-stream)
2008-07-07 17:16 UTC, Pedro F. Giffuni
no flags Details
patch-main.c (460 bytes, application/octet-stream)
2008-07-08 21:43 UTC, Pedro F. Giffuni
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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'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'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"