aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dtd_preparse.l
AgeCommit message (Collapse)AuthorFilesLines
2017-10-15Remove superfluous null-checks before strdup/freeAhmad Fatoum1-1/+1
NULL checks were removed for following free functions: - g_free "If mem is NULL it simply returns" https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-free - g_slist_free(_full)? "NULL is considered to be the empty list" https://developer.gnome.org/glib/stable/glib-Singly-Linked-Lists.html - g_strfreev "If str_array is NULL, this function simply returns." https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strfreev - g_slice_free "If mem is NULL, this macro does nothing." https://developer.gnome.org/glib/stable/glib-Memory-Slices.html#g-slice-free - g_match_info_free "not NULL... otherwise does nothing" https://developer.gnome.org/glib/stable/glib-Perl-compatible-regular-expressions.html#g-match-info-free - dfilter_free defined in Wireshark code. Returns early when passed NULL epan/dfilter/dfilter.c They were also removed around calls to g_strdup where applicable: - g_strdup "If str is NULL it returns NULL." https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strdup Change-Id: Ie80c2db89bef531edc3aed7b7c9f654e1d654d04 Reviewed-on: https://code.wireshark.org/review/23406 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-09-19Disable flex-generated [-Wsign-compare] warningsJoão Valverde1-0/+4
Change-Id: Iace0462e6bb50573f3e4603f7a19e4b7ee1f9733 Reviewed-on: https://code.wireshark.org/review/23541 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-02-24dtd: fix build due to -Wtypedef-redefinitionPeter Wu1-2/+2
dtd.h defines the type, so avoid redefining to avoid this warning: epan/dtd_preparse.l:113:3: warning: redefinition of typedef 'Dtd_PreParse_scanner_state_t' is a C11 feature [-Wtypedef-redefinition] Change-Id: Id6dddb8fe082717b483a6eeae08dfde468c19c89 Fixes: v2.3.0rc0-2505-ge1282f2875 ("dtd: free memory on shutdown.") Reviewed-on: https://code.wireshark.org/review/20266 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-02-24dtd: free memory on shutdown.Dario Lombardo1-7/+8
Change-Id: I502e505730b9310066563bfd9c8df9fceddd0301 Reviewed-on: https://code.wireshark.org/review/20229 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-12-02Include config.h at the very beginning of all Flex scanners.Guy Harris1-2/+5
That way, if we #define anything for large file support, that's done before we include any system header files that either depend on that definition or that define it themselves if it's not already defined. Change-Id: I9b07344151103be337899dead44d6960715d6813 Reviewed-on: https://code.wireshark.org/review/19035 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-04-03Make the Flex scanners and YACC parser in libraries reentrant.Guy Harris1-55/+110
master-branch libpcap now generates a reentrant Flex scanner and Bison/Berkeley YACC parser for capture filter expressions, so it requires versions of Flex and Bison/Berkeley YACC that support that. We might as well do the same. For libwiretap, it means we could actually have multiple K12 text or Ascend/Lucent text files open at the same time. For libwireshark, it might not be as useful, as we only read configuration files at startup (which should only happen once, in one thread) or on demand (in which case, if we ever support multiple threads running libwireshark, we'd need a mutex to ensure that only one file reads it), but it's still the right thing to do. We also require a version of Flex that can write out a header file, so we change the runlex script to generate the header file ourselves. This means we require a version of Flex new enough to support --header-file. Clean up some other stuff encountered in the process. Change-Id: Id23078c6acea549a52fc687779bb55d715b55c16 Reviewed-on: https://code.wireshark.org/review/14719 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-05Use noyywrap rather than defining our own yywrap functions.Guy Harris1-11/+5
Tweak lemonflex-tail.inc to fix an issue this reveals. It appears that, at least on the buildbots, the Visual Studio compiler no longer issues warnings for the code generated with %option noyywrap. Change-Id: Id64d56f1ae8a79d0336488a4a50518da1f511497 Reviewed-on: https://code.wireshark.org/review/12433 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-06Don't include io.h in Flex scanners - they're not interactive.Guy Harris1-1/+1
We don't have any Flex scanners that support an interactive command-line interface, so none of our scanners are, or need to be, interactive. Mark text2pcap's scanner as not interactive. That means none of our scanners should call isatty(), so they don't have any need to include <io.h> on Windows; remove that include from the Lucent/Ascent text capture scanner. Update a comment to reflect that what matters isn't whether we can read from a terminal or whether we actually do so, what matters is whether they read *interactively* from a terminal (if you want to run text2pcap reading from the standard input and type at it, be my guest). Change-Id: I59979d1fdb37e1913125a400963ff7a3fa6b9bbd Reviewed-on: https://code.wireshark.org/review/11587 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-14dtd_preparse : fix indent (Use tabs)Alexis La Goutte1-4/+4
Change-Id: Iec6ef7109ccea8a164db4f62af9fae1dceba6ae6 Reviewed-on: https://code.wireshark.org/review/5282 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-19Removed SVN Id from epan dir.Dario Lombardo1-2/+0
Change-Id: I487a3451344796447f0d5621b993cc89c29e93b5 Reviewed-on: https://code.wireshark.org/review/2383 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2013-03-16[-Wmissing-prototypes]Anders Broman1-2/+2
Use explicit casts. svn path=/trunk/; revision=48338
2013-02-10Add %option noinput to a bunch of Flex files, as we aren't using theGuy Harris1-0/+5
input() routine and thus don't need to have it generated - and as it produces warnings of a routine defined but not used, we don't want to have it generated. Squelch a casting-const-away warning. svn path=/trunk/; revision=47613
2013-02-08Constify the return value of replace_entity(), to squelch some warnings.Guy Harris1-2/+2
svn path=/trunk/; revision=47558
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45016
2012-02-02Include config.h in preparation of moving the definitionJörg Mayer1-0/+4
of _U_ from the compiler command line into config.h svn path=/trunk/; revision=40806
2011-06-28Replace all strerror() with g_strerror().Stig Bjørlykke1-1/+1
Remove our local strerror implementation. Mark strerror as locale unsafe API. This fixes bug 5715. svn path=/trunk/; revision=37812
2008-08-05luis.ontanon@gmail.com => luis@ontanon.orgLuis Ontanon1-1/+1
svn path=/trunk/; revision=25937
2008-05-22Move the file utility functions from wiretap to libwsutil so thatJeff Morriss1-24/+24
libwireshark (and the plugins using those functions) do not depend on wiretap on Windows. While doing that, rename the eth_* functions to ws_*. svn path=/trunk/; revision=25354
2008-05-11g_string_sprintf --> g_string_printf and g_string_sprintfa --> ↵Bill Meier1-5/+5
g_string_append_printf svn path=/trunk/; revision=25276
2008-04-25 Bug 2493: Fix (Part 3 of 3): Bill Meier1-0/+6
To prevent Windows compiler errors when using flex 2.5.35. Ignore 'signed /unsigned mismatch' warnings svn path=/trunk/; revision=25174
2008-04-25 Bug 2493: Fix (Part 2): Bill Meier1-5/+18
To prevent Windows compiler errors when using flex 2.5.35. Fixes "missing unistd.h" and yywrap "mismatched parameter" warnings [Upcoming Part 3: ignore 'signed /unsigned mismatch' errors] svn path=/trunk/; revision=25173
2007-10-12s/fopen()/eth_fopen()/ in an attempt to fix bug 1827: eth_fopen() deals with ↵Jeff Morriss1-1/+2
wide chars for us on Windows while fopen() does not. svn path=/trunk/; revision=23168
2007-08-04Add a script as a front-end for Flex, to work around various problems,Guy Harris1-0/+1
such as the fact that Flex strips all but the last component of the "-o" argument, and that it doesn't generate a header file to declare routines the generated lexical analyzer defines. Use that script when building lexical analyzers, and, for each lexical analyzer, include the generated header file in the generated analyzer. svn path=/trunk/; revision=22446
2007-07-30Add comments to various %option items to explain what they're doing. Guy Harris1-2/+23
Move the %options to the beginning if they weren't already there, and put them in the same order in all files. Add "prefix=" options to .l files that don't already have them, so we don't have to pass a "-P" option. Add "never-interactive" and "noyywrap" options to our lexical analyzers, to remove extra isatty() checks and to eliminate the need for yywrap() from the Flex library. Get rid of %option nostdinit - that's the default. Add .l.c: rules to Makefile.am files, replacing the rules for specific .l files. Have those rules all check that $(LEX) is set. Update the address for the FSF. svn path=/trunk/; revision=22424
2007-02-19Get rid of an unused variable.Guy Harris1-2/+0
svn path=/trunk/; revision=20841
2007-01-09make internal variables staticLuis Ontanon1-9/+9
svn path=/trunk/; revision=20352
2006-05-29Ethereal->WiresharkAnders Broman1-2/+2
svn path=/trunk/; revision=18248
2006-05-21name changeRonnie Sahlberg1-2/+2
svn path=/trunk/; revision=18197
2006-03-11Close the files after reading!Luis Ontanon1-1/+3
svn path=/trunk/; revision=17591
2005-11-10from albert chanRonnie Sahlberg1-2/+2
dont use a variable with the name dirname since it will collide with symbols on some hosts svn path=/trunk/; revision=16460
2005-10-06remove file inclusion code altoghether and few other changesLuis Ontanon1-32/+11
svn path=/trunk/; revision=16145
2005-09-28be more flexible in what's a nameLuis Ontanon1-1/+1
svn path=/trunk/; revision=16047
2005-09-22Make the private variables for various lexical analyzers static, soGuy Harris1-2/+2
that we don't have all the lexical analyzers in libethereal share them (note that they're already static in radius_dict.l, so they weren't sharing with any other lexical analyzer), and so that OS X 10.3.9's run-time linker doesn't get upset at finding them defined in libethereal and the MATE plugin. Fix up indentation. svn path=/trunk/; revision=15961
2005-09-17Because there's more than just text in XML...Luis Ontanon1-75/+10
DTDs are imported to create fields svn path=/trunk/; revision=15851
2005-09-10propperly handle the errors when loading a file fails.Luis Ontanon1-7/+30
svn path=/trunk/; revision=15751
2005-09-10don't use fgets() as MSVC does not implement it. use fgetc instead.Luis Ontanon1-6/+7
svn path=/trunk/; revision=15750
2005-09-10the dtd parser (still missing the glue) and few fixes to packet-xml.cLuis Ontanon1-0/+258
svn path=/trunk/; revision=15745