コード例 #1
0
int sh_prelink_set_path (const char * str)
{
  SL_ENTER(_("sh_prelink_set_path"));
  if (prelink_path != NULL)
    SH_FREE(prelink_path);
  if (str[0] != '/')
    {
      prelink_path = NULL;
      SL_RETURN((-1), _("sh_prelink_set_path")); 
    }
#ifdef SH_EVAL_SHELL
  prelink_path = sh_util_strdup(str);
  SL_RETURN(0, _("sh_prelink_set_path")); 
#else
  prelink_path = NULL;
  SL_RETURN((-1), _("sh_prelink_set_path"));
#endif
}
コード例 #2
0
ファイル: sh_readconf.c プロジェクト: stevehanlon/rinnegan
static char * sh_readconf_expand_value (const char * str)
{
#ifdef SH_EVAL_SHELL
  char * tmp = (char*)str;
  char * out;

  while (tmp && isspace((int)*tmp)) ++tmp;
  
  if (tmp && tmp[0] == '$' && tmp[1] == '(')
    {
      size_t len = strlen(tmp);
      while (isspace((int) tmp[len-1])) { tmp[len-1] = '\0'; --len; }
      if (tmp[len-1] == ')')
	{
	  tmp[len-1] = '\0';
	  out = sh_ext_popen_str(&tmp[2]);
	  return out;
	}
    }
#endif
  return sh_util_strdup(str);
}