ObjFW  Check-in [df94d134d9]

Overview
Comment:ofhash: Add language dir before parsing options
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: df94d134d9b6926ff73b762d6f76673870efcc639847850b6bd87d0fe7f44b95
User & Date: js on 2019-03-23 14:44:53
Other Links: manifest | tags
Context
2019-03-23
22:03
Add -[valueForKeyPath:] / -[setValue:forKeyPath:] check-in: d7824704f9 user: js tags: trunk
14:44
ofhash: Add language dir before parsing options check-in: df94d134d9 user: js tags: trunk
2019-03-21
23:29
ofhash: Allow calculating multiple hashes at once check-in: 0c72729961 user: js tags: trunk
Changes

Modified utils/ofhash/OFHash.m from [da64d5a676] to [95a4c46a8f].

88
89
90
91
92
93
94






95
96
97
98
99
100
101
102
103
104
105
106
107
108
109

110
111
112
113
114
115
116
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114

115
116
117
118
119
120
121
122







+
+
+
+
+
+














-
+







	OFMD5Hash *MD5Hash = nil;
	OFRIPEMD160Hash *RIPEMD160Hash = nil;
	OFSHA1Hash *SHA1Hash = nil;
	OFSHA224Hash *SHA224Hash = nil;
	OFSHA256Hash *SHA256Hash = nil;
	OFSHA384Hash *SHA384Hash = nil;
	OFSHA512Hash *SHA512Hash = nil;

#ifndef OF_AMIGAOS
	[OFLocale addLanguageDirectory: @LANGUAGE_DIR];
#else
	[OFLocale addLanguageDirectory: @"PROGDIR:/share/ofhash/lang"];
#endif

	while ((option = [optionsParser nextOption]) != '\0') {
		switch (option) {
		case '?':
			if (optionsParser.lastLongOption != nil)
				[of_stderr writeLine:
				    OF_LOCALIZED(@"unknown_long_option",
				    @"%[prog]: Unknown option: --%[opt]",
				    @"prog", [OFApplication programName],
				    @"opt", optionsParser.lastLongOption)];
			else {
				OFString *optStr = [OFString stringWithFormat:
				    @"%c", optionsParser.lastOption];
				[of_stderr writeLine:
				    OF_LOCALIZED(@"unkown_option",
				    OF_LOCALIZED(@"unknown_option",
				    @"%[prog]: Unknown option: -%[opt]",
				    @"prog", [OFApplication programName],
				    @"opt", optStr)];
			}

			[OFApplication terminateWithStatus: 1];
			break;
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
154
155
156
157
158
159
160






161
162
163
164
165
166
167







-
-
-
-
-
-








		[OFApplication activateSandbox: sandbox];
	} @finally {
		[sandbox release];
	}
#endif

#ifndef OF_AMIGAOS
	[OFLocale addLanguageDirectory: @LANGUAGE_DIR];
#else
	[OFLocale addLanguageDirectory: @"PROGDIR:/share/ofhash/lang"];
#endif

	if (!calculateMD5 && !calculateRIPEMD160 && !calculateSHA1 &&
	    !calculateSHA224 && !calculateSHA256 && !calculateSHA384 &&
	    !calculateSHA512)
		help();

	if (optionsParser.remainingArguments.count < 1)
		help();