Skip to content

Commit 0f6492d

Browse files
rootroot
authored andcommitted
[0039] 修改版权年份为2026,函数重命名 ini-trim 为 ini-string-trim
1 parent b8f6293 commit 0f6492d

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

goldfish/srfi/srfi-233.scm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
;;
2-
;; Copyright (C) 2024 The Goldfish Scheme Authors
2+
;; Copyright (C) 2026 The Goldfish Scheme Authors
33
;;
44
;; Licensed under the Apache License, Version 2.0 (the "License");
55
;; you may not use this file except in compliance with the License.
@@ -40,7 +40,7 @@
4040
) ;define
4141

4242
;; Trim leading and trailing whitespace (space/tab)
43-
(define (ini-trim str)
43+
(define (ini-string-trim str)
4444
(let ((len (string-length str)))
4545
(let loop-start
4646
((i 0))
@@ -79,12 +79,12 @@
7979
;; Parse a section header line like "[name]"
8080
;; Returns section name string, or #f if not a section header
8181
(define (parse-section-name line)
82-
(let* ((trimmed (ini-trim line)) (len (string-length trimmed)))
82+
(let* ((trimmed (ini-string-trim line)) (len (string-length trimmed)))
8383
(if (and (> len 1)
8484
(char=? (string-ref trimmed 0) #\[)
8585
(char=? (string-ref trimmed (- len 1)) #\])
8686
) ;and
87-
(ini-trim (substring trimmed 1 (- len 1)))
87+
(ini-string-trim (substring trimmed 1 (- len 1)))
8888
#f
8989
) ;if
9090
) ;let*
@@ -100,15 +100,15 @@
100100
(let ((line (read-line inport)))
101101
(cond ((eof-object? line) (eof-object))
102102
(else (let* ((no-comment (remove-comment line comment-delim))
103-
(trimmed (ini-trim no-comment))
103+
(trimmed (ini-string-trim no-comment))
104104
) ;
105105
(if (string=? trimmed "")
106106
(loop)
107107
(let ((section-name (parse-section-name trimmed)))
108108
(cond (section-name (set! current-section (string->symbol section-name)) (loop))
109109
(else (let ((kv (split-at-first trimmed key-value-sep)))
110110
(if kv
111-
(let ((key-str (ini-trim (car kv))) (val-str (ini-trim (cdr kv))))
111+
(let ((key-str (ini-string-trim (car kv))) (val-str (ini-string-trim (cdr kv))))
112112
(list current-section (string->symbol key-str) val-str)
113113
) ;let
114114
(list current-section (string->symbol trimmed) #f)

0 commit comments

Comments
 (0)