Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F132982945
D1663.id21625.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D1663.id21625.diff
View Options
Index: head/contrib/elftoolchain/elfcopy/main.c
===================================================================
--- head/contrib/elftoolchain/elfcopy/main.c
+++ head/contrib/elftoolchain/elfcopy/main.c
@@ -1529,6 +1529,22 @@
exit(EXIT_SUCCESS);
}
+/*
+ * Compare the ending of s with end.
+ */
+static int
+strrcmp(const char *s, const char *end)
+{
+ size_t endlen, slen;
+
+ slen = strlen(s);
+ endlen = strlen(end);
+
+ if (slen >= endlen)
+ s += slen - endlen;
+ return (strcmp(s, end));
+}
+
int
main(int argc, char **argv)
{
@@ -1562,12 +1578,16 @@
if ((ecp->progname = ELFTC_GETPROGNAME()) == NULL)
ecp->progname = "elfcopy";
- if (strcmp(ecp->progname, "strip") == 0)
+ if (strrcmp(ecp->progname, "strip") == 0)
strip_main(ecp, argc, argv);
- else if (strcmp(ecp->progname, "mcs") == 0)
+ else if (strrcmp(ecp->progname, "mcs") == 0)
mcs_main(ecp, argc, argv);
- else
+ else {
+ if (strrcmp(ecp->progname, "elfcopy") != 0 &&
+ strrcmp(ecp->progname, "objcopy") != 0)
+ warnx("program mode not known, defaulting to elfcopy");
elfcopy_main(ecp, argc, argv);
+ }
free_sec_add(ecp);
free_sec_act(ecp);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Oct 22, 7:48 PM (14 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24046963
Default Alt Text
D1663.id21625.diff (1 KB)
Attached To
Mode
D1663: elfcopy: Select mode by the end of the program name
Attached
Detach File
Event Timeline
Log In to Comment