summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-11 14:59:15 +0200
committerLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-11 14:59:15 +0200
commitb5f287577d924b9d5898602a11a2fd265bb9a84f (patch)
treea4c0e1f01711e57da5d5685f2fc075dc192b1c2e
parent4954fde9c7c7bb6644521dec0e43feb532f8ca42 (diff)
downloadpianobar-windows-b5f287577d924b9d5898602a11a2fd265bb9a84f.tar.gz
pianobar-windows-b5f287577d924b9d5898602a11a2fd265bb9a84f.tar.bz2
pianobar-windows-b5f287577d924b9d5898602a11a2fd265bb9a84f.zip
Update the station pointer when renaming station
-rw-r--r--libpiano/main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libpiano/main.c b/libpiano/main.c
index 7e9b129..895b01c 100644
--- a/libpiano/main.c
+++ b/libpiano/main.c
@@ -268,7 +268,7 @@ PianoReturn_t PianoRateTrack (PianoHandle_t *ph, PianoStation_t *station,
return ret;
}
-/* rename station
+/* rename station (on the server and local)
* @author PromyLOPh
* @added 2008-06-10
* @public yes
@@ -301,6 +301,11 @@ PianoReturn_t PianoRenameStation (PianoHandle_t *ph, PianoStation_t *station,
PianoHttpPost (ph->curlHandle, url, requestStr, &retStr);
ret = PianoXmlParseSimple (retStr);
+ if (ret == PIANO_RET_OK) {
+ free (station->name);
+ station->name = strdup (newName);
+ }
+
curl_free (urlencodedNewName);
free (xmlencodedNewName);
free (requestStr);