emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] unexec() for Cygwin port


From: Eli Zaretskii
Subject: Re: [PATCH] unexec() for Cygwin port
Date: 30 Mar 2004 08:24:19 +0200

Btw, the function reproduced below should use a case-insensitive
comparison to the ".exe" string, as I'm sure you didn't mean that the
dumping should fail when some weirdo shell or Make hands you a name
like "EMACS.EXE" instead of the expected "emacs.exe".

+static char *
+add_exe_suffix_if_necessary(const char *name, char *modified)
+{
+       int i = strlen(name);
+       if (i <= (sizeof(DOTEXE) - 1)) {
+               sprintf(modified, "%s%s", name, DOTEXE);
+       } else if (!strcmp(name + i - (sizeof(DOTEXE) - 1), DOTEXE)) {
+               strcpy(modified, name);
+       } else {
+               sprintf(modified, "%s%s", name, DOTEXE);
+       }
+       return(modified);
+}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]