From owner-svn-src-all@FreeBSD.ORG Sun Mar 29 22:00:25 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 975299FB; Sun, 29 Mar 2015 22:00:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8213AF68; Sun, 29 Mar 2015 22:00:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2TM0PZn059420; Sun, 29 Mar 2015 22:00:25 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2TM0Png059419; Sun, 29 Mar 2015 22:00:25 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201503292200.t2TM0Png059419@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 29 Mar 2015 22:00:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280830 - head/tools/regression/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2015 22:00:25 -0000 Author: jilles Date: Sun Mar 29 22:00:24 2015 New Revision: 280830 URL: https://svnweb.freebsd.org/changeset/base/280830 Log: wordexp(): Add testcase for non-default IFS in environment. The non-default IFS is expected to be used. MFC after: 1 week Modified: head/tools/regression/lib/libc/gen/test-wordexp.c Modified: head/tools/regression/lib/libc/gen/test-wordexp.c ============================================================================== --- head/tools/regression/lib/libc/gen/test-wordexp.c Sun Mar 29 21:53:08 2015 (r280829) +++ head/tools/regression/lib/libc/gen/test-wordexp.c Sun Mar 29 22:00:24 2015 (r280830) @@ -240,6 +240,21 @@ main(int argc, char *argv[]) r = unsetenv("IFS"); assert(r == 0); + /* + * With IFS set to a non-default value, and using it. + */ + r = setenv("IFS", ":", 1); + assert(r == 0); + r = wordexp("${IFS+hello:world}", &we, 0); + assert(r == 0); + assert(we.we_wordc == 2); + assert(strcmp(we.we_wordv[0], "hello") == 0); + assert(strcmp(we.we_wordv[1], "world") == 0); + assert(we.we_wordv[2] == NULL); + wordfree(&we); + r = unsetenv("IFS"); + assert(r == 0); + printf("PASS wordexp()\n"); printf("PASS wordfree()\n");