ObjFW  Diff

Differences From Artifact [59a725be71]:

To Artifact [d5afdd7b11]:


69
70
71
72
73
74
75
76
77

78
79
80
81
82
83
84
85
86

87
88
89

90
91
92
93







94
95
96
97
98
99
100
69
70
71
72
73
74
75


76
77
78
79
80
81
82
83
84

85



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104







-
-
+








-
+
-
-
-
+




+
+
+
+
+
+
+







}

@implementation OFHash
- (void)applicationDidFinishLaunching
{
	OFArray OF_GENERIC(OFString*) *arguments = [OFApplication arguments];
	id <OFHash> hash;
	OFEnumerator *enumerator;
	OFString *path;
	bool first = true;
	int exitStatus = 0;

	if ([arguments count] < 2)
		help();

	if ((hash = hashForName([arguments firstObject])) == nil)
		help();

	enumerator = [[arguments objectsInRange:
	for (OFString *path in arguments) {
	    of_range(1, [arguments count] - 1)] objectEnumerator];
	while ((path = [enumerator nextObject]) != nil) {
		void *pool = objc_autoreleasePoolPush();
		void *pool;
		OFStream *file;
		const uint8_t *digest;
		size_t i, digestSize;

		if (first) {
			first = false;
			continue;
		}

		pool = objc_autoreleasePoolPush();

		if ([path isEqual: @"-"])
			file = of_stdin;
		else {
			@try {
				file = [OFFile fileWithPath: path
						       mode: @"rb"];
			} @catch (OFOpenItemFailedException *e) {