forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

psp-config path fix.

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
anhanguera



Joined: 26 Aug 2004
Posts: 31

PostPosted: Wed Oct 12, 2005 7:08 pm    Post subject: psp-config path fix. Reply with quote

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.
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Thu Oct 13, 2005 5:34 am    Post subject: Reply with quote

committed, thx.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group