コード例 #1
0
ファイル: systems.c プロジェクト: Abocer/android-4.2_r1
static int
DecodeCtrlCommand(char *line, char *arg)
{
  const char *end;

  if (!strncasecmp(line, "include", 7) && issep(line[7])) {
    end = InterpretArg(line+8, arg);
    if (*end && *end != '#')
      log_Printf(LogWARN, "usage: !include filename\n");
    else
      return CTRL_INCLUDE;
  }
  return CTRL_UNKNOWN;
}
コード例 #2
0
ファイル: systems.c プロジェクト: AhmadTux/DragonFlyBSD
static int
DecodeCtrlCommand(char *line, char *arg, size_t argsiz)
{
  const char *end;

  if (!strncasecmp(line, "include", 7) && issep(line[7])) {
    end = InterpretArg(line+8, arg, argsiz);
    if (end == NULL) {
       log_Printf(LogWARN, "Failed to expand command '%s': too long for the "
                  "destination buffer\n", line);
       return CTRL_UNKNOWN;
    }
    if (*end && *end != '#')
      log_Printf(LogWARN, "usage: !include filename\n");
    else
      return CTRL_INCLUDE;
  }
  return CTRL_UNKNOWN;
}