Commit Graph

72 Commits

Author SHA1 Message Date
christos 052751eb98 Better fix for PR/42320 by Takehiko NOZAKI. 2009-11-21 17:57:09 +00:00
christos 0e17d27172 PR/42320: Alexander Nasonov: According to:
http://www.opengroup.org/onlinepubs/7990989775/xcu/awk.html
the LC_NUMERIC decimal point recognized is always period. Make it so.
2009-11-15 21:56:06 +00:00
roy 7027866a09 Rename internal getline() function to get_line() so it does
conflict with the soon to be added getline(3) libc function.
2009-07-13 19:05:39 +00:00
christos ac0ec62cd0 PR/40689: Nicolas Joly: awk(1) trashes memory with RE and ^ anchor
Another place to special-case HAT.
2009-06-21 20:08:44 +00:00
christos dc05b09461 PR/30294: John Darrow: nawk doesn't handle RS as a RE but as a single character 2009-06-20 23:23:12 +00:00
christos 94e9d9b7f6 fix EOF/-1 portability. 2009-06-16 13:56:09 +00:00
christos efdd16fa99 <= 2, from jukka salmi 2009-06-15 20:09:36 +00:00
christos ba7ea1e3fb purge/flush 0,1,2 since we did not open them, we should not be closing them.
s/EOF/-1/ as the documentation for fclose/pclose states.
2009-06-14 21:05:40 +00:00
njoly 56695ef522 In is_number(), do not check strtod() result against HUGE_VAL which
will result in a SIGFPE on non IEEE hardware. Instead, check the
provided buffer for "nan" string.

This make native build work again on alpha.
2009-03-12 13:04:01 +00:00
christos e5fb0732fe Use siginfo to print more details about the sigfpe. 2009-03-01 23:30:52 +00:00
christos 88bda1cea2 don't use signed chars for no reason. 2008-11-25 18:40:26 +00:00
apb 1dc9ff828c In preparation for building awk as a host tool, add
#if HAVE_NBTOOL_CONFIG_H #include "nbtool_config.h"
2008-10-19 19:33:47 +00:00
agc 7117be69ce Fix a fairly obvious pasto which has been there since version 1.1 in 2001. 2008-10-08 09:45:47 +00:00
christos 8c8950af64 PR/39501: David Holland: Don't print the remainder of the line in the error
context because it can confuse input parsing in warnings. A full explanation
is in the code.
2008-09-09 21:47:34 +00:00
joerg f628ddd81d As dholland pointed out, don't leak memory if FS is resized multiple
times.
2008-08-26 20:25:19 +00:00
joerg 479fba4b1b Don't use strlen to check if the length is at larger than 1, check the
first two chars directly.

Don't fail if FS is longer than 9 characters, but allocate a copy
dynamically and fail if that can't be done. Make inputFS static.

OK martin, bjs
2008-08-26 14:43:18 +00:00
joerg 0051d8ebe6 Don't strcpy after strdup. 2008-08-26 14:38:55 +00:00
he 4e9514ecb8 Add an overlooked semicolon to fix the build. 2008-07-14 06:14:44 +00:00
christos 96f87739b6 PR/39002: cheusov at tut dot br: Warn for \x where x is not a valid escaped
char.
2008-07-13 17:08:28 +00:00
christos e8c53cdebd sprintf -> snprintf 2008-07-12 19:57:59 +00:00
christos 19150c1762 explicitly disallow %L,%l,%h as TOG specifies. 2008-07-12 19:49:30 +00:00
christos f3e4d308aa PR/39133: cheusov at tut dot by: Don't treat -Ft as -F <tab> 2008-07-12 15:17:37 +00:00
christos e04577112e and remove debugging. 2008-07-11 23:06:48 +00:00
christos 86201bf107 better fix than before. Instead of copying the constant cells, set DONTFREE
on all non-strings.
2008-07-11 23:05:49 +00:00
christos 2a2697b888 PR/39132: cheusov at tut dot by: When copying an OCELL, make sure you make
a copy of its string and deal with DONTFREE properly, so that we don't try
to free the OCELL pointer later which points to a literal string in the text
segment.
2008-07-11 22:11:24 +00:00
christos f7e42af424 PR/38737: cheusov at tut dot by: Don't build the character class table
starting at 0, because will always be treated as the empty string DuH!
2008-05-25 16:28:25 +00:00
christos 2699db69d7 remove things we don't use. 2008-05-25 14:54:52 +00:00
christos 4459d9696e update to 20070501 2008-05-25 14:51:49 +00:00
christos 200d206cea from: http://cm.bell-labs.com/cm/cs/awkbook/index.html 2008-05-25 13:51:11 +00:00
christos 0f85ac800d Fix segmentation fault with printf("%*"); from Jukka Salmi 2008-01-21 17:18:06 +00:00
he 555e1d5a74 Remove a superfluous test, wcrtomb() cannot return (size_t)-2.
Pointed out by Aleksey Cheusov.
2007-10-25 22:22:41 +00:00
christos ba0aca47b0 PR/37205: Aleksey Cheusov: nawk: a number of open files is limited to very
small constant. Make the array of files dynamically allocated.
2007-10-25 15:12:03 +00:00
he 50d663aa6a Add support for multibyte charsets in the "tolower" and "toupper" awk
functions.  Code contributed by Aleksey Cheusov in PR#36394, and slightly
tweaked for closer-to-KNF conventions by me.  Also slightly improved checks
of error returns.
2007-10-25 14:44:49 +00:00
he c6b19d4d1d Bring back the fix in revision 1.6, apparently accidentally lost
during last merge, to allow escape of a newline in string literals.
2007-10-25 14:40:33 +00:00
apb 22d0439909 In setfval(), ensure that arithmetic never yields a negative zero
result.  Now {echo | awk '{print -1 * 0}'} prints "0" instead of "-0".

Fixes PR 36831.  Discussed in tech-userlevel.
2007-08-28 15:23:13 +00:00
christos 407a09df84 strdup/strlcat/snprintf changes from Aleksey Cheusov 2006-07-26 20:46:37 +00:00
christos f45b14fd95 add ytab.[ch] 2006-07-25 21:25:55 +00:00
christos cc3156aaa2 Change the meaning of state count to be the number allocated (like c does)
instead of the highest number allocated (fortran). Fixes off-by-one errors.
Also change the overallocation of n * 5 / 4 + 10 to just n + 10.
2006-07-25 20:52:57 +00:00
christos 295eac6574 make the gototab unsigned int 2006-06-26 17:58:25 +00:00
christos 80f0134faf - widen gototab so NCHARS states fits.
- don't allocate more space than we need.
From Aleksey Cheusov
2006-06-26 13:10:47 +00:00
christos a504bbc8d8 Don't forget to free gototab[i]; pointed out by Aleksey Cheusov 2006-06-25 22:37:45 +00:00
christos ab7ad9579e PR/33392: Aleksey Cheusov: Incorrect matching due to hard-coded limit in
number of states. Adapted from patch supplied.
2006-06-22 21:25:14 +00:00
christos a674b513c2 Coverity CID 2738: When a symbol with a NULL name is passed, convert it to
the empty symbol.
2006-03-21 16:59:09 +00:00
christos 6dccf87632 Avoid overflowing static array which c == HAT. 2006-03-19 17:41:55 +00:00
christos 57e31ffb5c Coverity CID 1867: Fix memory leak. 2006-03-18 22:39:40 +00:00
christos a1f97364cb Coverity CID 862: Avoid NULL deref. 2006-03-18 22:37:16 +00:00
christos 73a77c6016 Coverity CID 1476: Add assertion before index operation. 2006-03-18 22:35:42 +00:00
jdolecek e2ba6dc38f back-off 'use bounded string op' commit of 2003/08/13 - no real problem
has been fixed by it, but it introduced at least one bug

don't do any more of such gratuitous changes here, please
2005-07-03 15:18:11 +00:00
jdolecek e6b9888ace resolve conflicts 2005-07-02 20:10:34 +00:00
jdolecek 5a4553e726 this should not have been committed, sorry 2005-07-02 18:58:15 +00:00