summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2025-07-31 16:45:09 +0900
committerNobuyoshi Nakada <nobu.nakada@gmail.com>2025-08-01 00:15:27 +0900
commitb3598cf2a355497693bb66097edc156af3152e9b (patch)
treec4865a804346493679d8b6a596bc36159687da84 /win32
parent6c24904a690eb7c4e20c3fa8c3751acc03454100 (diff)
Win: Strip CRs from `cpp` and `nm` output
The combination of mingw tools and cygin/msys2 ruby leaves CRs.
Diffstat (limited to 'win32')
-rwxr-xr-xwin32/mkexports.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/win32/mkexports.rb b/win32/mkexports.rb
index 389b49def8..97939cdd09 100755
--- a/win32/mkexports.rb
+++ b/win32/mkexports.rb
@@ -146,7 +146,9 @@ class Exports::Cygwin < Exports
end
def each_line(objs, &block)
- IO.foreach("|#{self.class.nm} --extern-only --defined-only #{objs.join(' ')}", &block)
+ IO.popen(%W[#{self.class.nm} --extern-only --defined-only] + objs) do |f|
+ f.each(&block)
+ end
end
def each_export(objs)
@@ -155,7 +157,7 @@ class Exports::Cygwin < Exports
re = /\s(?:(T)|[[:upper:]])\s#{symprefix}((?!#{PrivateNames}).*)$/
objdump(objs) do |l|
next if /@.*@/ =~ l
- yield $2, !$1 if re =~ l
+ yield $2.strip, !$1 if re =~ l
end
end
end