psp-config path fix.

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
anhanguera
Posts: 31
Joined: Thu Aug 26, 2004 4:20 pm

psp-config path fix.

Post by anhanguera »

hi,

Code: Select all

# export PATH=/usr/local/pspdev/bin:$PATH
before patch;

Code: Select all

# psp-config -p
Error, invalid suffix on the end of the path. Should be /bin/psp-config
# /usr/local/pspdev/bin/psp-config -p
/usr/local/pspdev/psp/sdk
after patch;

Code: Select all

# psp-config -p
/usr/local/pspdev/psp/sdk
and here is the patch ;)
normalize_path is based on __psp_path_normalize [newlib/.../pspcwd.c]

Code: Select all

--- psp-config.c        Wed Oct 12 12:05:53 2005
+++ psp-config.new.c    Wed Oct 12 12:04:26 2005
@@ -86,6 +86,22 @@
        fprintf(stderr, "-P, --psp-prefix        : Print the prefix of PSP-hosted software\n");
 }

+void normalize_path (char *out)
+{
+       int i;
+       int j;
+
+       /* Convert "//" to "/" */
+       for (i = 0; out[i + 1]; i++) {
+               if (out[i] == '/' && out[i + 1] == '/') {
+                       for (j = i + 1; out[j]; j++) {
+                               out[j] = out[j + 1];
+                       }
+                       i--;
+               }
+       }
+}
+
 /* Find the path to the pspdev dir (e.g. /usr/local/pspdev) */
 char *find_pspdev_path(char *name)
 {
@@ -166,6 +182,8 @@
                        }
                }
        }
+
+       normalize_path(path);

        if(found)
        {
alper "anhanguera" akcan.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

committed, thx.
Post Reply