Skip to content

Commit

Permalink
fix: Support Windows CRLF line endings (#22)
Browse files Browse the repository at this point in the history
Report from NPlumb. Can easily test line endings
with `od -c f filename.txt`
  • Loading branch information
clburlison authored Apr 26, 2023
1 parent 0a4fd48 commit 2a9f12d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export SYSROOT = $(THEOS)/sdks/sdks-master/iPhoneOS14.5.sdk
THEOS_DEVICE_IP = iphone

PACKAGE_NAME = com.github.clburlison.dmon
PACKAGE_VERSION = 0.1.0
PACKAGE_VERSION = 0.1.1
HASH1 = $(shell shasum -a256 "packages/com.github.clburlison.dmon_$(PACKAGE_VERSION)_iphoneos-arm.deb" | cut -d " " -f1)
HASH2 = $(shell md5 "packages/com.github.clburlison.dmon_$(PACKAGE_VERSION)_iphoneos-arm.deb" | cut -d " " -f4)

Expand Down
5 changes: 3 additions & 2 deletions src/dmon.m
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ - (id)applicationsOfType:(unsigned int)arg1;
NSLog(@"dmon: Error reading file: %@", error);
return nil;
}

NSArray *lines = [fileContents componentsSeparatedByString:@"\n"];

NSCharacterSet *lineSeparatorSet = [NSCharacterSet characterSetWithCharactersInString:@"\n\r"];
NSArray *lines = [fileContents componentsSeparatedByCharactersInSet:lineSeparatorSet];
for (NSString *line in lines) {
NSArray *parts = [line componentsSeparatedByString:@": "];
if (parts.count == 2) {
Expand Down

0 comments on commit 2a9f12d

Please sign in to comment.