Back to index

tetex-bin  3.0
Functions
rm-suffix.c File Reference
#include <kpathsea/config.h>

Go to the source code of this file.

Functions

string remove_suffix P1C (const_string, s)

Function Documentation

string remove_suffix P1C ( const_string  ,
s   
)

Definition at line 25 of file rm-suffix.c.

{
  string ret;
  const_string suffix = find_suffix (s);
  
  if (suffix)
    {
      /* Back up to before the dot.  */
      suffix--;
      ret = (string) xmalloc (suffix - s + 1);
      strncpy (ret, s, suffix - s);
      ret[suffix - s] = 0;
    }
  else
    ret = (string) s;
    
  return ret;
}

Here is the call graph for this function: