[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: [AD] msvchelp
- From: Milan Mimica <milan.mimica@xxxxxxxxxx>
- Date: Wed, 03 May 2006 11:59:04 +0100
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:user-agent:mime-version:to:subject:content-type:from; b=T0/xOQ+SWX/OKpELApV6pqanjtZ/e1M1bak5BrJb0O5HddlvXU+fqnkjln6nWzmXdEV/x+rPKUK6DfJQ+eL9Z0MzhfvnQo1gHFCgtE+LYIaoa8ZF34V7QZeL3iDOou3LR3MCm2Qw3JYQf7jrgx2Xd72v/0C3pa+18jAJvKtAmXg=
There is a bug in msvchelp.exe program that converts long paths to short
format. It cannot find the supplied "MSVCDir" env variable because all
variables on windows are caps insensitive (probably just converted to
all caps internally) and getenv() is caps sensitive. Attached patch
fixes the problem by converting the supplied env variable to all caps.
--
Milan Mimica
http://sparklet.sf.net
Index: misc/msvchelp.c
===================================================================
--- misc/msvchelp.c (revision 5789)
+++ misc/msvchelp.c (working copy)
@@ -2,12 +2,13 @@
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
+#include <ctype.h>
int main(int argc, char *argv[])
{
char shortfilename[MAX_PATH];
char *longfilename;
- int ret;
+ int ret, i;
FILE *fout;
if (argc != 2) {
@@ -15,6 +16,11 @@
return 1;
}
+ for (i = 0; i < strlen(argv[1]); i++) {
+ char *c = argv[1] + i;
+ *c = toupper(*c);
+ }
+
longfilename = getenv(argv[1]);
if (longfilename == NULL) {
fprintf(stderr, "Given argument does not correspond to any enviroment variable name!\n");