anhanguera
Joined: 26 Aug 2004 Posts: 31
|
Posted: Wed Oct 12, 2005 7:08 pm Post subject: psp-config path fix. |
|
|
hi,
| Code: |
# export PATH=/usr/local/pspdev/bin:$PATH
|
before patch;
| Code: |
# 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: |
# 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: |
--- 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. |
|