Back to index

nagios-plugins  1.4.16
Functions
stripslash.c File Reference
#include <config.h>
#include "dirname.h"

Go to the source code of this file.

Functions

bool strip_trailing_slashes (char *file)

Function Documentation

bool strip_trailing_slashes ( char *  file)

Definition at line 31 of file stripslash.c.

{
  char *base = last_component (file);
  char *base_lim;
  bool had_slash;

  /* last_component returns "" for file system roots, but we need to turn
     `///' into `/'.  */
  if (! *base)
    base = file;
  base_lim = base + base_len (base);
  had_slash = (*base_lim != '\0');
  *base_lim = '\0';
  return had_slash;
}

Here is the call graph for this function: