Skip to content

Commit 676d83f

Browse files
committed
fix test and lib improvement
1 parent 8059e31 commit 676d83f

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

lib/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ install:
44
mkdir -p $(DESTDIR)/usr/lib/ || true
55
install libteaiso.so $(DESTDIR)/usr/lib/libteaiso.so
66
test:
7-
gcc util.c test.c -g -Wno-all -o a.out && ./a.out
7+
gcc util.c test.c -g -Wno-all -o a.out && ./a.out --variable "teaiso"
88
clean:
9-
rm -f libteaiso.so
9+
rm -f libteaiso.so

lib/test.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
char* get_argument_value(char* arg, char* val);
33
int main(){
44
/*Test some stuff*/
5-
warn(get_argument_value("variable=value","variable"));
5+
warn("this is warning","x");
66
out("this is output");
7+
err("this is error","y");
78
disable_color();
8-
err("this is error");
9+
err("this is error (nocolor)","z");
910
run("cat /etc/os-release | grep ^NAME=");
1011
}

lib/util.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ void set_rootfs(char* dir){
1212
void disable_color(){
1313
nocolor = 1;
1414
}
15+
// command pointer
16+
char* ncmd;
1517
int run(char* cmd){
16-
char* ncmd;
1718
if (strlen(cmd)<1){
1819
return 0;
1920
}if(strstr(cmd,"chroot||")){

0 commit comments

Comments
 (0)