diff --git a/weather.c b/weather.c index 66e78bc..58f27b1 100644 --- a/weather.c +++ b/weather.c @@ -1,4 +1,5 @@ /** + * this is a test * weather.c * Implementation of weather information fetching and display for Linux * Uses wttr.in service to display weather with its rich UI @@ -28,12 +29,12 @@ int lsh_weather(char **args) { // No location provided, use current location (blank parameter to wttr.in) location[0] = '\0'; } - + // Properly URL-encode spaces in the location char encoded_location[256] = ""; char *src = location; char *dst = encoded_location; - + while (*src) { if (*src == ' ') { *dst++ = '%'; @@ -45,12 +46,12 @@ int lsh_weather(char **args) { src++; } *dst = '\0'; - + // Format command with the location - using default wttr.in display format snprintf(command, sizeof(command), "curl -s wttr.in/%s", encoded_location); - + // Execute the command and display the full wttr.in UI system(command); - + return 1; -} \ No newline at end of file +}