tools.c: bugfixes to trim functions (Phil Slack)
authorArt Cancro <ajc@citadel.org>
Thu, 4 May 2023 22:14:10 +0000 (18:14 -0400)
committerArt Cancro <ajc@citadel.org>
Thu, 4 May 2023 22:14:10 +0000 (18:14 -0400)
commite9f3ccdaa47338e69818ef5c52ff2cac0767c08c
tree2e1ce6f46b4c2d4289e254229495445c74bfe243
parent26d8b550caf928eeca0bc70d5dd11580e7cdc2f2
tools.c: bugfixes to trim functions (Phil Slack)

libcitadel/lib/tools.c
  stripout()
    Strips too many characters.  Causes incorrect From address on inbound and probably other places.
       stripout(“Foobar<foobar@foobar.com>”) = Fooba.  Should be Foobar
    Mangles multiple boundaries. Should strip using outer boundaries.
      stripout(“ABC()(DEF)()GHI”) = ABC()(DEFGHI.  Should return ABCGHI.
  stripallbut()
    Handle outer boundaries like stripout()
      stripallbut(“ABC()(DEF)()GHI”) returns unchanged.  Should return )(DEF)(
    Code does a stderr flush.  Not sure why, but left it in.
  string_trimlen()
    Removed function.  Not used anywhere in the code and less efficient than string_trim()
libcitadel/lib/libcitadel.h
libcitadel/lib/tools.c