This is the mail archive of the cgen@sourceware.org mailing list for the CGEN project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch][commit] Location of (include file)


Thanks! I've commit the attached correction.

Dave

Thien-Thi Nguyen wrote:

  From: Dave Brolley <brolley@redhat.com>
  Date: Tue, 09 May 2006 14:22:02 -0400

+ ; 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)))))
+ )
+


guile> (version)
"1.4.1.107"
guile> (dirname "/etc/hosts")
"/etc"
guile> dirname
#<primitive-procedure dirname>

thi


2006-05-10  Dave Brolley  <brolley@redhat.com>

	* read.scm (-cgen): Add trailing "/" to arch-path.
	* utils.scm (dirname): Removed. dirname is a primitive function.

? cgen/string
Index: cgen/read.scm
===================================================================
RCS file: /cvs/src/src/cgen/read.scm,v
retrieving revision 1.12
diff -c -p -r1.12 read.scm
*** cgen/read.scm	9 May 2006 16:17:07 -0000	1.12
--- cgen/read.scm	10 May 2006 16:22:08 -0000
*************** Define a preprocessor-style macro.
*** 1074,1080 ****
  	      (else
  	       (cond ((str=? "-a" (car opt))
  		      (set! arch-file arg)
! 		      (set! arch-path (dirname arg))
  		      )
  		     ((str=? "-b" (car opt))
  		      (set! debugging #t)
--- 1074,1080 ----
  	      (else
  	       (cond ((str=? "-a" (car opt))
  		      (set! arch-file arg)
! 		      (set! arch-path (string-append (dirname arg) "/"))
  		      )
  		     ((str=? "-b" (car opt))
  		      (set! debugging #t)
Index: cgen/utils.scm
===================================================================
RCS file: /cvs/src/src/cgen/utils.scm,v
retrieving revision 1.19
diff -c -p -r1.19 utils.scm
*** cgen/utils.scm	9 May 2006 18:24:22 -0000	1.19
--- cgen/utils.scm	10 May 2006 16:22:08 -0000
***************
*** 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)
--- 155,160 ----

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]