From e7ce7c71c84e3e2a394562a6adec73062759f5df Mon Sep 17 00:00:00 2001 From: Nathan Wagner Date: Fri, 12 Oct 2018 11:07:24 +0000 Subject: [PATCH] make internal column function static --- t/findpkg.t | 46 ++++++++++++++++++++++++++++++++++++++++++++++ zpm-syncfs.c | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100755 t/findpkg.t diff --git a/t/findpkg.t b/t/findpkg.t new file mode 100755 index 0000000..ba8676d --- /dev/null +++ b/t/findpkg.t @@ -0,0 +1,46 @@ +#!/bin/sh + +. tap.sh + +plan 15 + +PF=test.db + +require rm -rf tmp +require mkdir tmp + +cd tmp || bailout 'can not cd to tmp' + +require zpm init $PF + +zpm newpackage -f $PF basics-1.0-1 +okexit create basics package + +n=$(zpm list -n -f $PF) +okexit list package name +okstreq "$n" "basics" package name + +n=$(zpm list -f $PF) +okexit list package name +okstreq "$n" "basics-1.0-1" package name + +id=$(zpm findpkg -f $PF basics) +okexit findpkg +okstreq "$id" "basics-1.0-1" found basics package + +id=$(zpm findpkg -f $PF basics-1.0) +okexit findpkg +okstreq "$id" "basics-1.0-1" found basics-1.0 package + +id=$(zpm findpkg -f $PF basics-1.0-1) +okexit findpkg +okstreq "$id" "basics-1.0-1" found basics-1.0-1 package + +id=$(zpm findpkg -f $PF basics-2.0-1) +failsok findpkg did not find wrong version + +cd .. || bailout 'can not cd up' +#rm -rf tmp + +finish + diff --git a/zpm-syncfs.c b/zpm-syncfs.c index 26414e9..c08407e 100644 --- a/zpm-syncfs.c +++ b/zpm-syncfs.c @@ -163,7 +163,7 @@ static int create_leading_dirs(char *path) { return 1; } -char *column(char *col, int ncols, char **vals, char **cols) { +static char *column(char *col, int ncols, char **vals, char **cols) { int i = 0; char *val = NULL; -- 2.40.0