Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a few bugs and code smells, but mostly convert to autotools #123

Merged
merged 8 commits into from
Sep 29, 2023

Commits on Sep 29, 2023

  1. Add missing error-checking for return value of fread

    Several calls to fread were missing checks to ensure that the expected
    amount of data was read.
    jikamens committed Sep 29, 2023
    Configuration menu
    Copy the full SHA
    a8c1523 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1c6d7a9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7330357 View commit details
    Browse the repository at this point in the history
  4. Comment out small block of code that doesn't do anything

    There's a small block of code that calls strnlen on a string, saves
    the esult in a variable, conditionally decrements the variable, and
    then does nothing with it, making the entire block of code a no-op.
    
    I don't want to just remove it entirely since it's possible that there
    was intended to be some sort of check here that was inadvertently
    omitted. So to make the compiler stop complaining I've commented out
    the code, but I've left a comment above it explaining why it was
    commented out and pointing out that maybe something different needs to
    be done with it.
    jikamens committed Sep 29, 2023
    Configuration menu
    Copy the full SHA
    cf757ca View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    443f460 View commit details
    Browse the repository at this point in the history
  6. Fix broken curl HTTP response code check

    The check for the HTTP response code from the curl library was written
    incorrectly and guaranteed to always fail. I've fixed the logic to
    reflect what I believe was intended.
    jikamens committed Sep 29, 2023
    Configuration menu
    Copy the full SHA
    fc6ae24 View commit details
    Browse the repository at this point in the history
  7. Fix minor logic bug and code smell in make_link_relative

    Don't assume that the reason why we didn't find enough slashes in a
    URL is because the user didn't specify the slash at the end of the
    host name, unless we did find the first two slashes.
    
    Add some curly braces around an if block to make it clear to people
    and the compiler which statement an `else` applies to. The logic was
    correct before but the indentation was wrong, making it especially
    confusing.
    jikamens committed Sep 29, 2023
    Configuration menu
    Copy the full SHA
    840d5fb View commit details
    Browse the repository at this point in the history
  8. Convert build process to use autotools (autoconf, automake, etc.)

    This commit converts the build process from a hand-written Makefile
    that works on Linux, FreeBSD, and macOS, to an automatically generated
    Makefile managed by the autotools toolset.
    
    This incldues:
    
    * Add the compile, config.guess, config.sub, depcomp, install-sh, and
      missing helper scripts that autotools requires to be shipped with
      the package in order for configure to work.
    * Rename Makefile to Makefile.am and restructure it for compatibility
      with autotools and specifically with the stuff in our configure
      script.
    * Create the configure.ac source file which is turned into the
      configure script.
    * Rename Doxyfile to Doxyfile.in so that the source directories can be
      substituted into it at configure time.
    * Tweak .gitignore to ignore temporary and output files related to
      autotools.
    * Generate Makefile.in, aclocal.m4, and configure using `autoreconf`
      and include them as checked-in source files.
    
    While I can't fully document how autotools works here the basic
    workflow is that when you need to make changes to the build, you
    update Makefile.am and/or configure.ac as needed, run `autoreconf`,
    and commit the changes you made as well as any resulting changes to
    Makefile.in, aclocal.m4, and configure. Makefile should _not_ be
    committed into the source tree; it should always be generated using
    configure on the system where the build is being run.
    jikamens committed Sep 29, 2023
    Configuration menu
    Copy the full SHA
    3f679b4 View commit details
    Browse the repository at this point in the history