-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path9-replace_code.c
More file actions
55 lines (49 loc) · 1.17 KB
/
9-replace_code.c
File metadata and controls
55 lines (49 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <stdio.h>
#include "main.h"
/**
* exit_ieie - replaces code in 6-main.c
* @ieie: status with which to be exited
* @arr: array, to be freed
* @buffer: the buffer for the main function
* Definition - replaces code to shorten main function
* in order to pass betty checks
* Return: void
*/
void exit_ieie(int ieie, char **arr, char *buffer)
{
free(arr);
free(buffer);
buffer = NULL;
arr = NULL;
exit(ieie);
}
/**
* not_path_frees - frees certain memory allocated due to processing
* commands that are paths.
* @comm_path: command path
* @new_array: new array with command path
* @dir_loc: (is_found.dir_loc)
* Description - replaces some code in not_builtin_for_non_path
* function.
* Return: void
*/
void not_path_frees(char *comm_path, char **new_array, char *dir_loc)
{
free(dir_loc);
free(comm_path);
free(new_array);
dir_loc = NULL;
comm_path = NULL;
new_array = NULL;
}
/**
* find_command_replace - replaces two lines of code in function find_command
* @path2: malloc allocated replicate of PATH
* Definition - replaces two lines of code in function find_command
* Return: void
*/
void find_command_replace(char *path2)
{
free(path2);
path2 = NULL;
}