This is the mail archive of the
cgen@sourceware.org
mailing list for the CGEN project.
Re: [patch][commit] Location of (include file)
- From: Dave Brolley <brolley at redhat dot com>
- To: cgen at sources dot redhat dot com
- Date: Tue, 09 May 2006 14:22:02 -0400
- Subject: Re: [patch][commit] Location of (include file)
- References: <4460C206.9080103@redhat.com>
Forgot to include this part which also goes with this patch....
Dave
2006-05-09 Dave Brolley <brolley@redhat.com>
* utils.scm (dirname): New function.
Index: cgen/utils.scm
===================================================================
RCS file: /cvs/src/src/cgen/utils.scm,v
retrieving revision 1.18
diff -c -p -r1.18 utils.scm
*** cgen/utils.scm 15 Jun 2005 21:28:19 -0000 1.18
--- cgen/utils.scm 9 May 2006 18:19:54 -0000
***************
*** 1,5 ****
; Generic Utilities.
! ; Copyright (C) 2000-2005 Red Hat, Inc.
; This file is part of CGEN.
; See file COPYING.CGEN for details.
--- 1,5 ----
; Generic Utilities.
! ; Copyright (C) 2000-2005, 2006 Red Hat, Inc.
; This file is part of CGEN.
; See file COPYING.CGEN for details.
***************
*** 155,160 ****
--- 155,169 ----
(->string str))
)
+ ; Return the directory name of the given file name
+
+ (define (dirname s)
+ (let loop ((i (string-length s)))
+ (cond ((= i 0) "")
+ ((char=? #\/ (string-ref s (- i 1))) (substring s 0 i))
+ (else (loop (- i 1)))))
+ )
+
; Turn STR into lowercase.
(define (string-downcase str)