From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,2863b4c0f0c83c1b X-Google-Attributes: gidf678f,public X-Google-Thread: fee84,2863b4c0f0c83c1b X-Google-Attributes: gidfee84,public From: "Gleb O. Rajko" Subject: Re: gnu tar 1.11.8 on DUNIX 4.0 -- won't compile -- fnmatch() problem Date: 1996/09/11 Message-ID: <32368260.167E@cecmow.enet.dec.com>#1/1 X-Deja-AN: 179894938 references: to: "fineman@grizzly.cs.washington.edu"@vbormc.vbo.dec.com content-type: text/plain; charset=us-ascii organization: Moscow Software Center, Digital Equipment Corp. mime-version: 1.0 newsgroups: comp.unix.osf.misc,comp.unix.osf.osf1 x-mailer: Mozilla 3.0 (X11; I; OSF1 V4.0 alpha) Dan Fineman wrote: > I'm trying to compile gnu tar 1.11.8 on a Dec Alpha running DUNIX 4.0 > (a.k.a. osf4.0). Unfortunately, it just ain't happening. > ----------------- > gcc -c -DHAVE_CONFIG_H -I.. -I../intl -I. -I../lib -g -O tar.c > tar.c: In function `name_match': > tar.c:477: `FNM_LEADING_DIR' undeclared (first use this function) > tar.c:477: (Each undeclared identifier is reported only once > tar.c:477: for each function it appears in.) > tar.c: In function `name_scan': > tar.c:608: `FNM_LEADING_DIR' undeclared (first use this function) > tar.c: In function `check_exclude': > tar.c:828: `FNM_LEADING_DIR' undeclared (first use this function) > *** Exit 1 > ----------------- > Anyways, I noted that on a linux system of mine, > /usr/include/fnmatch.h has this line: > --------- > #define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ > --------- Looks like you should change FNM_LEADING_DIR to FNM_NOESCAPE to compile this code on Digital Unix. >From man page on fnmatch(3) FNM_NOESCAPE Unless FNM_NOESCAPE is set, preceding a character in pattern with a \ (backslash character) causes fnmatch() to match that character in string. For example, \\ matches a backslash in string. If FNM_NOESCAPE is set, \ (backslash) is interpreted as an ordinary character. from /usr/include/fnmatch.h: #define FNM_NOESCAPE 8 /* Don't treat backslash as an escape */ Concerning 1 << 3 = 8 and FNM_LEADING_DIR sounds to be functional equivalent for FNM_NOESCAPE, I guess they are the same. Hope this helps, Gleb.