[AD] msvchelp

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


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");


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/