1
0

argv_delete.c 637 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * argv_delete.c
  3. */
  4. #include "private.h"
  5. #include "lub/string.h"
  6. #include <stdlib.h>
  7. /*--------------------------------------------------------- */
  8. static void
  9. lub_argv_fini(lub_argv_t *this)
  10. {
  11. unsigned i;
  12. lub_string_free(this->line);
  13. this->line = NULL;
  14. for(i = 0;
  15. i < this->argc;
  16. i++)
  17. {
  18. lub_string_free(this->argv[i].arg);
  19. }
  20. free(this->argv);
  21. this->argv = NULL;
  22. }
  23. /*--------------------------------------------------------- */
  24. void
  25. lub_argv_delete(lub_argv_t *this)
  26. {
  27. lub_argv_fini(this);
  28. free(this);
  29. }
  30. /*--------------------------------------------------------- */