bitwiseworks / libc

LIBC Next (kLIBC fork)
9 stars 4 forks source link

getcwd uppercases first part of path #132

Closed psmedley closed 1 year ago

psmedley commented 1 year ago

Describe the bug getcwd upeprcases first part of path - ie u:/development/qtbase becomes u:/DEVELOPMENT/qtbase

To Reproduce Simple testcase below


#include <unistd.h>
#include <stdio.h>
#include <limits.h>
int main() {
   char cwd[PATH_MAX];
   if (getcwd(cwd, sizeof(cwd)) != NULL) {
       printf("Current working dir: %s\n", cwd);
   } else {
       perror("getcwd() error");
       return 1;
   }
   return 0;

```}

**Expected behavior**
Expect path to be returned in lowercase
psmedley commented 1 year ago

OK, bit more investigation. I set the cwd from the WPS - even though 4os2 shows U:\development - internally (somewhere) it's U:\DEVELOPMENT.

I've worked around this for now using a chdir command to ensure the directory is all lowercase

dryeo commented 1 year ago

On 07/22/23 04:33 PM, Paul Smedley wrote:

OK, bit more investigation. I set the cwd from the WPS - even though 4os2 shows U:\development - internally (somewhere) it's U:\DEVELOPMENT.

I've worked around this for now using a chdir command to ensure the directory is all lowercase

Long filename EA out of sync? Seems there is an issue where this happens. https://88watts.net/download/eaclean-1.3.zip has a parameter to remove unnecessary .LONGNAME EAs (-c2) or even more aggressively, -c3 which should not be used on boot volumes. It's basic job is to remove all the EAs that libc adds

psmedley commented 1 year ago

Steven confirmed this is a WPS bug - even though the working directory is set in lower case, OS/2 or the WPS uppercases it.