summaryrefslogtreecommitdiff
path: root/main.c
AgeCommit message (Collapse)Author
2023-02-01Avoid depending on xprotoFabian Vogt
makedepend is rather early in the distro bootstrap chain, so it shouldn't pull in anything it doesn't really need. xproto is only pulled in for two macros which we can just as easily provide ourselves.
2023-01-01Make more things static that aren't needed in more than one fileAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-01Call strrchr() instead of hand coding a custom versionAlan Coopersmith
Also correct comments on hand-coded custom strcmp() replacements Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-01Cache filename after realpath() processingAlan Coopersmith
Avoid having to make an additional system call for every time we compare full path names. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-01Make malloc error checking/reporting more consistentAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-01Handle some implicit conversion warnings from clangAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-01Use reallocarray() on systems that provide itAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-01Store predefined -D values in const char fieldsAlan Coopersmith
Clears up 28 -Wdiscarded-qualifiers warnings from gcc Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-12Reformat code into X.Org standard coding styleAlan Coopersmith
Make indentation and formatting much more consistent across this project Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-04-10Close fd for reading old Makefile when done, instead of leaking itAlan Coopersmith
Found by Oracle Parfait: Error: File Leak File Leak [file-ptr-leak]: Leaked File fdin at line 799 of main.c in function 'redirect'. fdin initialized at line 769 with fopen Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-05-05Remove unused variable whitespaceAlan Coopersmith
Use of it was removed in commit 275c17136006f9d, but we kept setting it anyway. Resolves gcc 7.3 warning: main.c: In function ‘getnextline’: main.c:587:10: warning: variable ‘whitespace’ set but not used [-Wunused-but-set-variable] boolean whitespace = FALSE; ^~~~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-03-24missing bounds check in makedepend for file argumentsDirk
When assigning source code files from the command line to the fp pointer, no bounds check is done and if more than MAXFILES file names are specified on the command line, memory will be overridden out of bounds. https://bugs.freedesktop.org/show_bug.cgi?id=94099 Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Tested-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-02Don't crash if an option's argument is missingJulien Cristau
Avoid dereferencing argv[argc]. See http://www.forallsecure.com/bug-reports/011f1a55f79a5501b36008d6ee0d40e8b6644569/ Reported-by: Alexandre Rebert <alexandre@cmu.edu> Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-02-23Assume signal handlers return void, as C89 requiresAlan Coopersmith
Drops use of autoconf's obsolete AC_TYPE_SIGNAL Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-02-12Store len in a size_t instead of an int in redirect()Alan Coopersmith
Fixes clang warnings about converting back & forth: main.c:761:8: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32] len = strlen(line); ~ ^~~~~~~~~~~~ main.c:763:41: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] if (*buf == '#' && strncmp(line, buf, len) == 0) ~~~~~~~ ^~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-20Mark fatalerr & catch as _X_NORETURNAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-16Bug 52099 - makedepend rename fails on CIFS mounted sharesGlenn Burkhardt
Patch v1: https://bugs.freedesktop.org/attachment.cgi?id=64218 v2: modified by Alan Coopersmith to restore Makefile to original name if contents cannot be read, instead of leaving it moved to .bak name. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-11Fix a comment typoAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-05Convert more sprintf calls to snprintfAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-05Remove unnecessary casts from malloc/realloc callsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-05Remove fallbacks for Imake configuration, assume autoconfAlan Coopersmith
For the original 6.9/7.0 release, we supported using either autoconf or imake to generate configuration. For releases after that, we're only supporting autoconf, so no longer need to check & fall back to imake. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-04unifdef -U__UNIXOS2__Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-07Call strdup directly, instead of via copy macroAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-07Add const attributes to fix gcc -Wwrite-strings warningsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-07Strip trailing whitespaceAlan Coopersmith
Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}' git diff -w & git diff -b show no diffs from this change Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2009-10-10Remove CVS/RCS version tagsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-03-24Fix gcc, sparse & lint warningsAlan Coopersmith
cppsetup.c:74:9: warning: Using plain integer as NULL pointer parse.c: In function `gobble': parse.c:94: warning: int format, long int arg (arg 2) parse.c: In function `find_includes': parse.c:641: warning: int format, long int arg (arg 2) parse.c:664: warning: int format, long int arg (arg 2) parse.c:677: warning: int format, long int arg (arg 2) parse.c:684: warning: int format, long int arg (arg 2) pr.c: In function `add_include': pr.c:57: warning: int format, long int arg (arg 4) pr.c:59: warning: int format, long int arg (arg 3) declared global, could be static sig_act main.c(142) predefs main.c:imakemdep.h(51) Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-03-24Increased constificationAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-03-24Add additional predefines needed to match Solaris compilersAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-03-24Delete portions of imakemdep.h not used by makedependAlan Coopersmith
This header was shared by imake & makedepend in the monolith, but each got its own copy in the modular builds. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2005-07-05Bugzilla #2901 <https://bugs.freedesktop.org/show_bug.cgi?id=2901> PatchXORG-6_8_99_16XORG-6_8_99_15Alan Coopersmith
#2320 <https://bugs.freedesktop.org/attachment.cgi?id=2320> Remove warning about whitespace in pre-processor defines. (Peter Breitenlohner)
2005-05-15[Modularization/autotooling project] Add support for building with autoconfXORG-6_8_99_9XORG-6_8_99_8XORG-6_8_99_14XORG-6_8_99_13XORG-6_8_99_12XORG-6_8_99_11XORG-6_8_99_10Alan Coopersmith
#ifdefs if present. #include "makedepend-config.h" if HAVE_CONFIG_H is defined.
2004-04-23Merging XORG-CURRENT into trunkXACE-SELINUX-MERGEEgbert Eich
2004-03-14Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004xf86-4_4_99_1Egbert Eich
2004-03-03Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004xf86-4_4_0STSF-CURRENTEgbert Eich
2004-02-26readding XFree86's cvs IDsxf86-4_3_99_903Egbert Eich
2004-02-26Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004Egbert Eich
2003-11-25XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_902xf86-4_3_99_901xf86-4_3_99_16Kaleb Keithley
2003-11-14XFree86 4.3.0.1xf86-4_3_0_1PRE_xf86-4_3_0_1Kaleb Keithley
2003-11-14R6.6 is the Xorg base-lineXORG-MAINXORG-STABLEKaleb Keithley