OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [libc/] [posix/] [wordfree.c] - Blame information for rev 345

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
/* Copyright (C) 2002 by  Red Hat, Incorporated. All rights reserved.
2
 *
3
 * Permission to use, copy, modify, and distribute this software
4
 * is freely granted, provided that this notice is preserved.
5
 */
6
 
7
#ifndef _NO_WORDEXP
8
 
9
#include <sys/param.h>
10
#include <sys/stat.h>
11
 
12
#include <ctype.h>
13
#include <dirent.h>
14
#include <errno.h>
15
#include <glob.h>
16
#include <pwd.h>
17
#include <stdio.h>
18
#include <stdlib.h>
19
#include <string.h>
20
#include <unistd.h>
21
 
22
#include <wordexp.h>
23
 
24
void
25
wordfree(wordexp_t *pwordexp)
26
{
27
  int i;
28
 
29
  if (pwordexp == NULL)
30
    return;
31
 
32
  if (pwordexp->we_wordv == NULL)
33
    return;
34
 
35
  for(i = 0; i < pwordexp->we_wordc; i++)
36
    free(pwordexp->we_wordv[i]);
37
 
38
  free(pwordexp->we_wordv);
39
  pwordexp->we_wordv = NULL;
40
}
41
 
42
#endif /* !_NO_WORDEXP  */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.